Hi everybody,
I'm generating some DIVs dinamically, inclusive of
an event function to run when the user clicks on them.
While the following lines work perfectly in FF 1.5,
I.E. 6.0 ignores the onclick function alltogether:
the flow never gets into it, as if it hadn't been registered
properly. Yet, an inspection of the DOM with the
developer toolbar, reveals that the function is correctly
associated with the onclick attribute.
This is the code:
var imgNumber = 1;
var imgDot = document.createElement('div');
var onClickFunction = "ss_displayNthPicture("+imgNumber+")";
imgDot.setAttribute("onclick",onClickFunction);
document.body.appendChild(imgDot);
Any idea? Am I doing something wrong with quotes
and double quotes maybe? Or are there limitations
on the events a dynamically generated DIV can trigger?
Thanks for your help.
Manu