2021年3月13日星期六

How to find all matching classes with Javascript and allow them all to run a function

The below will only find the first .available class and run my fuction. I need it to find all .available classes so that all of them can fun the function.

How would I do this?

this.DOM = {};  this.DOM.available = this.DOM.product.querySelector('.available');    this.DOM.available.addEventListener('click', () => this.open());  
https://stackoverflow.com/questions/66620413/how-to-find-all-matching-classes-with-javascript-and-allow-them-all-to-run-a-fun March 14, 2021 at 10:04AM

没有评论:

发表评论