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

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -