javascript - addEventListener click seemingly storing up clicks -


i've got javascript code called html page. on html page, i've got button id "button_id". want function dostuff() occur when click button, , bit of javascript achieves this:

document.getelementbyid("button_id").addeventlistener("click", function() {     dostuff(); }, false); 

however, when other things clicked on html page (and work normally), , come click on "button_id" button, dostuff() executed lots of times. seems if other clicks getting saved eventlistener , getting released @ once.

what's causing this, , how solve problem? btw, i've been using chrome.

thanks.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -