Hi,
I'm having issues with setting the value of onclick in a link element.
Having read this article and the other article it links too, I still dont have a solution.
It might be due to the fact that the function 'name' is being taken from an array of function names! See here:
Code:
var hooks = new Array("TTselectAll","TTselectNone");
for ( var i in hooks )
{
var target = document.getElementById(hooks[i]);
target.setAttribute('onclick',hooks[i]+"();");
}
As is often the case, it works fine in FF but not in IE6 or 7.
I have tried the following and this stops working in all browsers!
Code:
target.onclick = function() {hooks[i]+"();"};
...and this...
Code:
var tag = hooks[i]+"();";
target.onclick = function() {tag};
If anyone can suggest a workround for both FF and IE6 and 7 I would be very grateful.
Thanks,
Brick...