SVG <set> Element Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report SVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas. The SVG <set> element provides an easy means of just setting the value of an attribute for a specified duration. It supports all attribute types, including those that cannot reasonably be interpolated, such as string and boolean values. Syntax: <set attributeName="" value="" /> Attribute: to: This attribute defines the value to be applied to the target attribute for the duration of the animation.Animation Attributes: Attributes used to give animation effects, exp timing attributes, event attributes, and value attributes, etc.Global Attributes: some global attributes used like core attributes and styling attributes, etc. Example 1: html <!DOCTYPE html> <html> <body> <svg viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"> <rect id="me" width="10" height="10"> <set attributeName="fill" to="green" /> </rect> </svg> </body> </html> Output: Example 2: html <!DOCTYPE html> <html> <body> <svg width="400" height="200" xmlns="http://www.w3.org/2000/svg"> <a> <text x="50" y="90" text-anchor="middle"> Click Here </text> <set attributeName="href" to="https://www.youtube.com/watch?v=Abwl8g65BLQ%22&feature=youtu.be /> </a> </svg> </body> </html> Output: Supported Browsers: Chrome 1 and aboveEdge 79 and aboveFirefox 4 and aboveSafari 3 and aboveOpera 12.1 and aboveInternet Explorer not supported Comment T taran910 Follow 0 Improve T taran910 Follow 0 Improve Article Tags : Web Technologies HTML HTML-SVG SVG-Element Explore HTML BasicsHTML Introduction5 min readHTML Editors5 min readHTML Basics7 min readStructure & ElementsHTML Elements5 min readHTML Attributes8 min readHTML Headings4 min readHTML Paragraphs5 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks3 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables10 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics6 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List15+ min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like