I’m trying to unbind all events from a handler with out using a framework, is this correct? They’re both Divs and those are the ids, it just doesn’t seem to work.
function reply_click(d_850)
{
document.getElementById("directions").onsubmit = null;
}
No. There’s
removeEventListener(anddetachEventin IE), but they need explicit references to the functions they should remove. There is no catch-all mechanism. You’d need to store all bound functions separately for a remove-all-of-type-X method when adding them, this is what jQuery does for example.The only chance left is to rebuild your DOM, which removes all previously bound handlers entirely.