Javascript examples for DOM:Element ownerDocument
The ownerDocument property returns the owner document of a node, as a Document object.
The owner document of the node, as a Document object
The following code shows how to get the node type of the owner document of a <p> element:
<!DOCTYPE html> <html> <body> <p id="myP">test</p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww.j a v a 2 s .c o m*/ var x= document.getElementById("myP").ownerDocument.nodeType; document.getElementById("demo").innerHTML = x; } </script> </body> </html>