470,624 Members | 2,159 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,624 developers. It's quick & easy.

How to make a click event using JavaScript?

Prakash Gnana
Please help me to get the answer..
Thanks..
Jan 28 '11 #1
2 2326
Dormilich
8,656 Expert Mod 8TB
the DOM events, which include the click event are defined here.
Jan 28 '11 #2
from html form element you can fire onclick() event as below ::

Expand|Select|Wrap|Line Numbers
  1. <input type="button" name="btn1" id="btn1" value="Click Me" onclick="alert('hi);">
and if you wanna to make OnClick() event which trigger from javascript then make this code ::


Expand|Select|Wrap|Line Numbers
  1. function fun1()
  2. {
  3.       getElementById("btn1").click();
  4. }
May 16 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Andy Rose | last post: by
4 posts views Thread by =?Utf-8?B?TWFyaw==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.