Using jQuery, I have an element with multiple event handlers set different ways. The code is long, legacy code, so I would like to change as little as possible. However, I need to, at different times, remove ALL the event handlers at once.
Below is an example of the various handlers attached to the element:
$('#myElement').focus( function() {//Do Something} );
$('#myElement').keydown( function() {//Do Something} );
$('#myElement').submit( function() {//Do Something} );
$('#myElement').bind( function() {//Do Something} );
$('#myElement').click( function() {//Do Something} );
My question: Can all of these be removed with one call of .off()?
$('#myElement').off();
Or do they all need to use .on to be removed with .off?