Javascript – How to find multiple elements in HTML by comparison to an array of data attributes?
Given HTML: <div class="element" data-name="cat"> <div class="element" data-name="bird"> <div class="element" data-name="dog"> I want to find only the elements that match a data attribute that im keeping in an array like this let Array1 = ["dog","cat","lizard"] I thought I could do…