from html form element you can fire onclick() event as below ::
- <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 ::
- function fun1()
-
{
-
getElementById("btn1").click();
-
}