About 136,000 results
Open links in new tab
  1. How can I listen to the form submit event in javascript?

    192 I wanna write my own form validation javascript library and I've been looking on google how to detect if a submit button is clicked but all I found is code where you have to use onClick on …

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

    Jan 15, 2009 · 1154 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 …

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

    If event listener is no longer needed but we forget to remove it, the function will keep hanging around in memory. If the element to which the event was attached gets removed from the …

  4. 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?

  5. 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 …

  6. Event when window.location.href changes - Stack Overflow

    How can I get an event (via window.addEventListener or something similar) when window.location.href changes on a page? I also need access to the DOM of the document …

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

    Context: Attaching event listeners to elements dynamically created from an Ajax response. Making an selectable by click, or by keyboard navigation: In both cases, the same function is …

  8. How to make JavaScript execute after page load? - Stack Overflow

    In this example, the DOMContentLoaded event is used to ensure that the JavaScript code inside the event listener is executed only after the HTML document has been completely loaded and …

  9. How do I detect keypresses in Javascript? - Stack Overflow

    Apr 18, 2013 · One more thing: How do I remove this event listener? I tried with document.removeEventListener(), but it doesn't work: the listener continues to be active, i.e. …

  10. JavaScript window resize event - Stack Overflow

    Mar 13, 2009 · How can I hook into a browser window resize event? There's a jQuery way of listening for resize events but I would prefer not to bring it into my project for just this one …