Skip to content

Instantly share code, notes, and snippets.

View StevenWuTG's full-sized avatar

Steven Wu StevenWuTG

  • New York
View GitHub Profile
const grandparent = document.getElementById("grandparent")
//or
const parent2 = grandparent.getElementById("parent-2")
<body>
<div class="grandparent" id="grandparent">
<!-- "parent-1" & "parent-2" belongs to "grandparent"-->
<div class="parent" id="parent-1">
<!-- "child-1" & "child-2" belongs to "parent-1"-->
<div class="child" id="child-1">
</div>
<div class="child" id="child-2">
</div>
</div>