About 4,560,000 results
Open links in new tab
  1. javascript - addEventListener vs onclick - Stack Overflow

    This Stack Overflow page discusses the differences between addEventListener and onclick in JavaScript.

  2. JavaScript: What is addEventListener? - Stack Overflow

    Apr 23, 2010 · The addEventListener method is the W3C standard method to attach an event handler to an element, so that you can do something useful when an event is triggered. The following example …

  3. javascript - How to pass arguments to addEventListener listener ...

    Nov 2, 2008 · Learn how to pass arguments to addEventListener listener functions effectively in JavaScript with this guide.

  4. javascript - Cannot read property 'addEventListener' of null - Stack ...

    On those pages where the function cannot find the id, I receive a "Cannot read property 'addEventListener' of null " error and none of my other functions work. Below is the code for the …

  5. javascript - Correct usage of addEventListener () / attachEvent ...

    The difference being is that attachEvent can only be used on older rendering engines ( IE5+ IE5-8*) and addEventListener is a W3 standard that is implemented in the majority of other browsers (FF, …

  6. Pure JavaScript listen to input value change - Stack Overflow

    Apr 4, 2023 · el.addEventListener('input', function () { fn(); }); But, if you want to fire event when you change inputs value manually via JavaScript you should use custom event (any name, like …

  7. AddEventListener on all created li elements - Stack Overflow

    You'll have to set the eventListener on each single item, as document.getElementsByClassName() returns a collection of items and you can't simply add an event listener to all of them with one call of …

  8. javascript - How to addEventListener to multiple elements in a single ...

    Dec 4, 2016 · element1 && element2.addEventListener("input", function() { // this function does stuff }); It might not be correct grammatically, but is there a way I can give two elements the same event …

  9. javascript - Difference between document.addEventListener and …

    While using PhoneGap, it has some default JavaScript code that uses document.addEventListener, but I have my own code which uses window.addEventListener: function onBodyLoad(){ document.

  10. javascript - addEventListener using for loop and passing values - Stack ...

    I'm trying to add event listener to multiple objects using a for loop, but end up with all listeners targeting the same object --> the last one. If I add the listeners manually by defining boxa an...