I have this very simple demo:
function foo() {
alert('Works!');
}
var inp = document.createElement('input');
inp.onblur = foo;
document.body.appendChild(inp);
See here: http://jsfiddle.net/A7aPA/
As you can see, this works. (Click on the input, then click somewhere else and an alert will pop up.)
However, if I add this line to the JavaScript code:
document.body.innerHTML += '<br>';
then the blur handler stops working (and no error is thrown btw).
See here: http://jsfiddle.net/A7aPA/1/
Why is that?