JavaScript node.ownerDocument Property
JavaScript node.ownerDocument Property
The node.ownerDocument
property returns the top-level document object in which all the child nodes are created.
Note: This property is read-only.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<body>
<p>Open your console (Press F12) and Click on the button</p>
<button onclick="myFunction()">Click Me</button>
<script>
var y = document.getElementsByTagName("p")[0];
function myFunction(){
console.log(y.ownerDocument);
}
</script>
</body>
</html>
Syntax
node.ownerDocument
Return Values
Value | Explanation |
---|---|
Object | Returns the top-level Document object in which all the child nodes are created. |
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.