About 13,900,000 results
Open links in new tab
  1. 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 …

  2. javascript - addEventListener vs onclick - Stack Overflow

    Although there are advantages of using addEventListener() but you should still be careful if your targeting audience is using Internet Explorer then this method might not work in all situation. …

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

    (addEventListener only) If true, indicates that the user wishes to initiate capture. Explanation.

  4. How to pass arguments to addEventListener listener function?

    Nov 2, 2008 · someObj.addEventListener("click", some_function.bind(this), false); Or to capture some of the lexical scope, for example in a loop: someObj.addEventListener("click", …

  5. JavaScript click event listener on class - Stack Overflow

    Aug 9, 2016 · The addEventListener call should look like: elem.addEventListener('click', myFunction, false) and classname is a NodeList type. Need to loop over all the elements and …

  6. Binding multiple events to a listener (without JQuery)?

    Jan 10, 2012 · ['mousemove', 'touchmove'].forEach(function(event) { window.addEventListener(event, handler);}); would not only be way more readable but also …

  7. Add an onchange event listener to an html input field

    addEventListener("change", function(){...}); seems to work for the last element in the document if used in the same page how can I solve this. I have three sets of forms on the same page but …

  8. The value of "this" within the handler using addEventListener

    Aug 27, 2009 · I've created a Javascript object via prototyping. I'm trying to render a table dynamically. While the rendering part is simple and works fine, I also need to handle certain …

  9. How can I listen to the form submit event in javascript?

    Apr 29, 2016 · in the same spirit, we really should try writing more assembly language. Half-joking (I quite prefer a jquery solution and think it's an endless rabbit hole if you really want to …

  10. How can I remove a JavaScript event listener? - Stack Overflow

    You'll need a signal object passed to addEventListener: const controller = new AbortController(); randomElement.addEventListener('click', randomCallback, {'signal':controller.signal}); Once …