About 50 results
Open links in new tab
  1. JavaScript click event listener on class - Stack Overflow

    Aug 9, 2016 · If you use element.addEventListener ('click', event => { } to add the event to the element, the javascript will check every click internally anyway. If you add the event to all element of classes …

  2. javascript - How can I register a new event listener with a function ...

    Jun 8, 2025 · 0 So I've been trying to make a game to learn some JavaScript, but whenever I try to create a new event listener through a function, then changing the target argument simply overrides …

  3. How to find event listeners on a DOM node in JavaScript or in …

    Jan 15, 2009 · 1161 I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for …

  4. javascript - addEventListener vs onclick - Stack Overflow

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

  5. Attach event to dynamic elements in JavaScript - Stack Overflow

    Your code example lacks the important part of adding a listener, hence giving the false impression that somehow magically this is achieved by using document.createElement. You must attach the event …

  6. JavaScript window resize event - Stack Overflow

    Mar 13, 2009 · Instead, create a function to add an Event Listener to the object or element. This checks and incase the listeners don't work, then it overrides the object's function as a last resort. This is the …

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

    JavaScript change value To change the input value by JavaScript and make important events work, you need to dispatch at least two events by order. One is input and two is change. So that you can focus …

  8. javascript - Add event listener on every link - Stack Overflow

    Apr 27, 2015 · Event delegation allows you to avoid adding event listeners to specific nodes; instead, the event listener is added to one parent. That event listener analyzes bubbled events to find a …

  9. javascript - Detect browser or tab closing - Stack Overflow

    Oct 8, 2010 · Is there any cross-browser JavaScript/jQuery code to detect if the browser or a browser tab is being closed, but not due to a link being clicked?

  10. reactjs - Event Listener Being Added Multiple Times in JavaScript ...

    Mar 21, 2025 · I have a problem where an event listener is being added multiple times in my JavaScript code, which is making my app slow. The Problem I am adding a dblclick event listener to all …