In my code, an event handler for an element is set which changes that element's css height to 100px. At somewhere else, I want a different event handler to be run if certain conditions meet, which should override the previous event handler and change its height to 200px.
Is there a way to do that, or to clear all previously set event handlers for an element?
Yes, just use .off()
, like
$('selector').off('eventname')