EventHandler

Apr 28 2010 2:45 AM

I want to attach an eventhandler to a html control in javascript code.
I tried using code like this:
    var textBox = document.createElement('textarea');
    textBox.setAttribute('cols', '14');
    textBox.setAttribute('rows', '3');
    textBox.setAttribute('id', GetTextBoxID(mainCell));
    textBox.setAttribute('onblur', 'ChangeNodeName(' + textBox.id.toString() + ');');
    mainCell.appendChild(textBox);

but the eventhandler doesn't execute.
what is the problem?
is there other ways? 

Answers (1)