I'm trying to iterate over elements with the same class in order to see if within a specific element a button has a specific class. I understand how this would be done in jQuery however the project does not have jQuery, so this has to be done with vanilla JS...which I'm not as familiar with.
let boardItems = document.getElementsByClassName("item--product");
for (let i = 0; i < boardItems.length; i++) {
if(boardItems.children.classList.contains('board-item-selected')){
console.log(i);
}
}
what I'd like is to get the index number of each item that does contain the class in the child.