M
Moses
Hi Everybody,
I have a problem with onClick event which works in FF and does not
work in IE, Here I have giving the details Please help.
I am creating a <a> Tag.
dom_obj = document.createElement('a');
dom_obj.setAttribute('href', 'javascript:void(0)');
dom_obj.setAttribute('onclick', 'javascript:test()');
val = document.createTextNode('Click');
dom_obj.appendChild(val);
The output is
<a href="javascript:void(0)"
onclick="javascript:test()">Click</a>
Now as everybody knows on Clicking the link the function
test() should be called.
The problem is it works in FF and it does not work in IE,
meanwhile if I change href="javascript:test()" the function is called
properly. The thing is IE is not firing the onclick event.
I tried a lot but I could not find out what is the reason
for that , So looking forward for your help.
Thanks & Regards
Moses
I have a problem with onClick event which works in FF and does not
work in IE, Here I have giving the details Please help.
I am creating a <a> Tag.
dom_obj = document.createElement('a');
dom_obj.setAttribute('href', 'javascript:void(0)');
dom_obj.setAttribute('onclick', 'javascript:test()');
val = document.createTextNode('Click');
dom_obj.appendChild(val);
The output is
<a href="javascript:void(0)"
onclick="javascript:test()">Click</a>
Now as everybody knows on Clicking the link the function
test() should be called.
The problem is it works in FF and it does not work in IE,
meanwhile if I change href="javascript:test()" the function is called
properly. The thing is IE is not firing the onclick event.
I tried a lot but I could not find out what is the reason
for that , So looking forward for your help.
Thanks & Regards
Moses