Add event listener to multiple buttons with the same class

PHOTO EMBED

Tue Jul 26 2022 02:40:42 GMT+0000 (Coordinated Universal Time)

Saved by @leahp #javascript

    btns = document.getElementsByClassName("saveBtn");
    for (let i = 0; i < btns.length; i++) {
        btns[i].addEventListener("click", function () {
			//Add function here
        });
    }
content_copyCOPY

https://www.thiscodeworks.com/add-event-listener-to-multiple-buttons-with-the-same-class-javascript/5efa75c76c23bc0014be6336