Add event listener to multiple buttons with the same class
05 December 2021
CSS
JavaScript
event
Add event listener to multiple buttons with the same class
btns = document.getElementsByClassName("saveBtn");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function () {
//Add function here
});
}