Top "Addeventlistener" questions

a DOM event method that adds an event listener to a given DOM node

What is a proper way to add listeners to new elements after using AJAX to get the html content? (jQuery, Javascript)

I am making something that can loads new setting pages via AJAX, I am not sure what's the most efficient …

javascript jquery ajax addeventlistener
Textarea Character Count using JavaScript

I am implementing a character count for my form's textarea field. I have jQuery currently counting and writing my character …

javascript jquery textarea addeventlistener charactercount
Trouble with setTimeout with addEventListener

I have a vimeo video that I want to play 3 seconds after a button is clicked. I can get the …

javascript settimeout addeventlistener froogaloop
`return false` in an event handler attached by addEventListener or element.on*

Right let’s get this out the way first. Yes, I want to hide the context menu. No, I’m …

javascript dom-events addeventlistener preventdefault
React setState hook from scroll event listener

First of all, with a class component, this works fine and does not cause any issues. However, in functional component …

javascript reactjs addeventlistener react-hooks
onClick priority over addEventListener in javascript?

Right now, I have an event listener that listens to a click on the screen. There is also a button …

javascript onclick handler addeventlistener
Attach keyboard events to html5 canvas

It looks like mouse events will add listeners to canvas elements fine, but keyboard events don't seem to be working …

html5-canvas dom-events addeventlistener
Form is still submitted even though listener function returns false

I'm trying to figure out why this JavaScript doesn't stop the form from being submitted: <form action="http://www.…

javascript forms addeventlistener onsubmit
$(document).on() in plain JavaScript?

In jQuery there is .on() which can be used as: $(document).on('click', '.foo', function() { /* ... */ }); This listens for click …

javascript jquery dom addeventlistener mutation-observers
How can I listen for modal close event?

I need to know when my modal has been closed. There doesn't seem to be an explicit way to do …

ionic2 modal-dialog addeventlistener