docs.rodeo

MDN Web Docs mirror

id

{{SVGRef}} 

The id attribute assigns a unique name to an element.

You can use this attribute with any SVG element.

Example

<svg
  width="120"
  height="120"
  viewBox="0 0 120 120"
  xmlns="http://www.w3.org/2000/svg">
  <style>
    <![CDATA[
      #smallRect {
        stroke: #000066;
        fill: #00cc00;
      }
    ]]>
  </style>

  <rect id="smallRect" x="10" y="10" width="100" height="100" />
</svg>

{{EmbedLiveSample("Example", "120", "120")}} 

Usage notes

Value <id>
Default value None
Animatable No

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN