Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | DOM adoptNode() Method

  • Last Updated : 09 Jun, 2021

This DOM adoptNode() method is used to adopt a node from another document. All node types can be adopted. All child nodes along with the original node can be adopted. AdoptNode() method is used to return node objects.


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.


Parameter Value: DOM adoptNode() method contains only one method described below.  

  • node: Any type of node is required.

Return Value: It returns a node object, representing the adopted node.



<!DOCTYPE html>
<button onclick="adopt()">Press</button>
</center> </h1>
        <h4>Clicking on the 'Press' button
will showcase adopt() method</h4>
    <p id="gfg">
        function adopt() {
            var frame =
            var h =
            // 'h' is button type adopted node.
            var x = document.adoptNode(h);

Before pressing the button: 

After pressing the button: 

Note: All child nodes are adopted.

Browser Support: The browsers support by DOM adoptNode() method are listed below:  

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!