Skip to content

Commit

Permalink
*
Browse files Browse the repository at this point in the history
  • Loading branch information
imteekay committed Jan 30, 2024
1 parent d9a21be commit 240c7ea
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const dom1 = document.createElement('div');
dom1.innerHTML = `
<main>
<h1>Heading</h1>
<div>
<h2>test1</h2>
<p>test2 <em>emphasis</em></p>
</div>
</main>
`;

const dom2 = document.createElement('main');
dom2.innerHTML = `
<article>
<h1>Heading2</h1>
<section>
<img src="img.png" alt="image" />
<h3>test5 <strong>strong</strong></h3>
</section>
</article>
`;

correspondingNode(dom1, dom2, dom1); // dom2
correspondingNode(dom1, dom2, dom1.querySelector('h2')); // <img src="img.png" alt="image" />
correspondingNode(dom1, dom2, dom1.querySelector('em')); // <strong>strong</strong>

0 comments on commit 240c7ea

Please sign in to comment.