HighDots Forums  

Re: Adding onClick() dynamically not working, Why ?

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Adding onClick() dynamically not working, Why ? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Randy Webb
 
Posts: n/a

Default Re: Adding onClick() dynamically not working, Why ? - 02-06-2008 , 03:10 AM






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/


Reply With Quote
  #2  
Old   
Prince of Code
 
Posts: n/a

Default Re: Adding onClick() dynamically not working, Why ? - 02-06-2008 , 04:02 AM






It works Works

Thanks a lot for great info
Prince

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.