I am dynamically adding events using addEvent(keydown, function() {});
to an element. My problem is that there are times when this code get's run on the same element twice or more. The behavior becomes clunky as the function registered for that event runs a couple of times.
Is there a way for me to only run the code above only once on an element? Maybe check if the event has already been added before?