Finding child element of parent with JavaScript

If you already have var parent = document.querySelector('.parent'); you can do this to scope the search to parent‘s children:

parent.querySelector('.child')

Leave a Comment