SVG Window.document Property
Last Updated :
30 Mar, 2022
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:
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...