diff options
Diffstat (limited to 'files/fa/web/api/node/isequalnode/index.html')
-rw-r--r-- | files/fa/web/api/node/isequalnode/index.html | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/files/fa/web/api/node/isequalnode/index.html b/files/fa/web/api/node/isequalnode/index.html deleted file mode 100644 index 9cc089f509..0000000000 --- a/files/fa/web/api/node/isequalnode/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: Node.isEqualNode() -slug: Web/API/Node/isEqualNode -translation_of: Web/API/Node/isEqualNode ---- -<div> -<div>{{APIRef("DOM")}}</div> -</div> - -<p>The <code><strong>Node.isEqualNode()</strong></code> method tests whether two nodes are equal. Two nodes are equal when they have the same type, defining characteristics (for elements, this would be their ID, number of children, and so forth), its attributes match, and so on. The specific set of data points that must match varies depending on the types of the nodes.</p> - -<h2 id="Syntax" name="Syntax">Syntax</h2> - -<pre class="syntaxbox">var <var>isEqualNode</var> = <var>node</var>.isEqualNode(<var>otherNode</var>); -</pre> - -<ul> - <li><code>otherNode</code>: The {{domxref("Node")}} to compare equality with.</li> -</ul> - -<h2 id="Example">Example</h2> - -<p>In this example, we create three {{HTMLElement("div")}} blocks. The first and third have the same contents and attributes, while the second is different. Then we run some JavaScript to compare the nodes using <code>isEqualNode()</code> and output the results.</p> - -<h3 id="HTML">HTML</h3> - -<pre class="brush: html"><div>This is the first element.</div> -<div>This is the second element.</div> -<div>This is the first element.</div> - -<p id="output"></p></pre> - -<div class="hidden"> -<h3 id="CSS">CSS</h3> - -<pre class="brush: css">#output { - width: 440px; - border: 2px solid black; - border-radius: 5px; - padding: 10px; - margin-top: 20px; - display: block; -}</pre> -</div> - -<h3 id="JavaScript">JavaScript</h3> - -<pre class="brush: js">let output = document.getElementById("output"); -let divList = document.getElementsByTagName("div"); - -output.innerHTML += "div 0 equals div 0: " + divList[0].isEqualNode(divList[0]) + "<br/>"; -output.innerHTML += "div 0 equals div 1: " + divList[0].isEqualNode(divList[1]) + "<br/>"; -output.innerHTML += "div 0 equals div 2: " + divList[0].isEqualNode(divList[2]) + "<br/>";</pre> - -<h3 id="Results">Results</h3> - -<p>{{ EmbedLiveSample('Example', 480) }}</p> - -<h2 id="Specifications">Specifications</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('DOM WHATWG', '#dom-node-isequalnode', 'Node.isEqualNode')}}</td> - <td>{{Spec2('DOM WHATWG')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - - - -<p>{{Compat("api.Node.isEqualNode")}}</p> - -<h2 id="See_also">See also</h2> - -<ul> - <li>{{domxref("Node.isSameNode()")}}</li> -</ul> |