How to use DOM Node isSameNode in JavaScript

In this article I am going to explain about DOM Node isSameNode() method in JavaScript.
  • 1875

JavaScript DOM Node isSameNode() Method

JavaScript isEqualNode() method use for check two node is same or not. If node are same then it will return true other wise it will return false.






    <script type="text/javascript">

        function myfun() {

            var mm = document.getElementById("list");

            var hh = document.getElementsByTagName("UL")[0];

            var x = document.getElementById("tst");

            x.innerHTML = mm.isSameNode(hh);





    <h1 id="tst" style="color: Blue">


    <ul id="list">



        click button to check list element are same or not</p>

    <button onclick="myfun()">









You may also want to read these related articles: here
Ask Your Question 
Got a programming related question? You may want to post your question here


More Articles

© 2020 DotNetHeaven. All rights reserved.