I am trying to dynamically change the onClick evenHandler using:
I did an alert for objImg.parentElement.parentElement.outerHTML it looks
exactly the same as a static working version., but the onClick event is not firing off! Why?
am i no allowed to set onClick??
btw, doing the following has the same effect
Btw, this is happening on IE6 SP1
Code:
var sNoteOnClickJs = 'showDetails()'; //showDetails is a JavaScript function defined in the same HTML page.
objImg.onclick =sNoteOnClickJs; //objImg is a <img> tag in a <td>
I did an alert for objImg.parentElement.parentElement.outerHTML it looks
exactly the same as a static working version., but the onClick event is not firing off! Why?
am i no allowed to set onClick??
btw, doing the following has the same effect
Code:
objImg.setAttribute('onclick',sNoteOnClickJs);
Btw, this is happening on IE6 SP1