Doesnt work ...
$("#cleanMsg").removeAttr("keypress"); // <- doesnt work
$("#cleanMsg").removeAttr("onkeypress"); // <- doesnt work: although I expected it would ??
$("#cleanMsg").keypress(null); // <- doesnt work: I had to kill the process!
$("#cleanMsg").keypress(function(){}); // <- works but inefficient and less than ideal ...
By ideal I mean something like ...
var cleanMsg = document.getElementById('cleanMsg');
var originalKeypress = cleanMsg.onkeypress;
// bind new function ...
cleanMsg.onkeypress = someFunction;
function someFunction(){
// do operations
// unbind function ..
cleanMsg.onkeypress = originalKeypress;
}
So has anyone worked out how to do that in jQuery coz its got me stumped?
If I work it out Ill return here n post it up.
Thanks, Eugene.