Prince of Code said the following on 2/6/2008 2:22 AM:
Quote:
Hey all,
I m trying to add onClick() event dynamically using DOM Method . But
why the event is not able to be triggered. Also I dont see it in the
DOM Source. Pls find the code for refrence.
Your explanation would be greatly useful. |
<snip>
Quote:
// Why is the I am not able to call the onclick event
handler ??????????????
atag.onClick="hellofn();" |
Javascript is case sensitive and onclick isn't the same as onClick.
Re-code it using onclick instead and then drop the quotes and the () so
that it becomes:
atag.onclick=hellofn;
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -
http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/