Hang event on all elements by class. Javascript open

Hang event on all elements by class. Javascript

Approved. Code works!
This is exactly the working code that is verified by the moderator or site administrators
//search elements
const starter_button = document.querySelectorAll(".starter-batton");

[].forEach.call( starter_button, function(el) {
  //hang event
  el.onclick = function(e) {
    alert('yeah')
  }
});
0

More

Leave a Reply

Your email address will not be published. Required fields are marked *

How many?: 22 + 22

lil-code© | 2022 - 2024
Go Top
Authorization
*
*
Registration
*
*
*
*
Password generation