Answers for "query selector click event"

4

document queryselector click event

const buttons = document.querySelectorAll("#select .button")
for (const button of buttons) {
  button.addEventListener('click', function(event) {
    //...
  })
}
Posted by: Guest on April-07-2020
1

query selector click event

var deleteLink = document.querySelector('.delete');

deleteLink.addEventListener('click', function(event) {
    event.preventDefault();

    var choice = confirm("sure u want to delete?");
    if (choice) {
        return true;
    }
});
Posted by: Guest on April-11-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language