I have keydown event on element.
$("#element").keydown(function() {
// do stuff!
});
Now I want to remove it.
I tried unbind
and off
but neither are working.
$("#element").unbind("click");
$("#element").off("click");
Do I need to do .on("click", function...)
or .bind("click", function...)
instead of .click
if using unbind
or off
. If so, this is not my code and I am not allowed to modify it, so I need an alternative way.
Is there any other way than 'unbind' or 'off' that actually works?
Thanks, help greatly appreciated!!