Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body id="myBody">
  <div class="module"></div>
  <div class="module"></div>
  
</body>
</html>
 
let myBody = document.getElementById('myBody'),
    otherBody = document.body,
    moduleOne = document.querySelectorAll('.module')[0],
    moduleTwo = document.querySelectorAll('.module')[1];
// using isSameNode
console.log(myBody.isSameNode(otherBody));
console.log(moduleOne.isSameNode(moduleTwo));
// using isEqualNode
console.log(myBody.isEqualNode(otherBody));
console.log(moduleOne.isEqualNode(moduleTwo));
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
ImpressiveWebspro
0viewers