JavaScripture
Contribute via GitHub
Feedback
SVGElement
Instance Properties
id
ownerSVGElement
viewportElement
xmlbase
SVG API
All API
No API set selected.
SVGElement
:
Element
SVGElement represents an element in the SVG document tree. SVGElement is the base type for
SVGSVGElement
,
SVGRectElement
,
SVGImageElement
, and many others.
Spec
Instance Properties
id
:
String
Example:
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' > <rect id='foo' width='30' height='40' fill='black'/> </svg> <script> var foo = document.getElementById('foo'); console.log(foo.id); </script>
Run
Results:
Spec
ownerSVGElement
:
SVGSVGElement
readonly
Example:
<svg id='svgelement' xmlns='http://www.w3.org/2000/svg' version='1.1'> <rect id='foo' width='30' height='40' fill='black'/> </svg> <script> var svgelement = document.getElementById('svgelement'); var foo = document.getElementById('foo'); console.log(foo.ownerSVGElement === svgelement); </script>
Run
Results:
Spec
viewportElement
:
SVGElement
readonly
Example:
<svg id='svgelement' xmlns='http://www.w3.org/2000/svg' version='1.1'> <rect id='foo' width='30' height='40' fill='black'/> </svg> <script> var svgelement = document.getElementById('svgelement'); var foo = document.getElementById('foo'); console.log(foo.viewportElement === svgelement); </script>
Run
Results:
Spec
xmlbase
:
String
Spec
home
license
contribute
feedback
toggle light/dark mode
Copyright © JavaScripture Contributors