SVG Window.document Property
The SVG Window.document property returns a reference to the document contained in the window.
Syntax:
var object = window.document
Return value: This property returns a reference to the document contained in the window.
Example 1:
HTML
<!DOCTYPE html><html> <body> <svg viewBox="0 0 1000 1000" <circle cx="200" cy="200" r="50"></circle> <script type="text/javascript"> console.log(window.document); </script> </svg></body> </html> |
Output:
Example 2:
HTML
<!DOCTYPE html><html> <body> <svg viewBox="0 0 1000 1000" <text x="200" y="200"> GeeksforGeeks </text> <script type="text/javascript"> console.log(window.document); </script> </svg></body> </html> |
Output:
Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML course.


