Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i am beginner in asp.net. Can any one give me the exact code for automatic button click and say me how i shoud execute it.Thanks!
Posted

Hi ,

check this once it can do what you want

HTML
    <script language ="javascript" >
        var tmp;
        function f1() {
            tmp = setTimeout("callitrept()", 2000);
        }
        function callitrept() {
            document.getElementById("Button1").click();
        }
    </script>
</head>
<body onload="f1()">


In the above code Button1 is id of button which you want to perform click operation

All the Best
 
Share this answer
 
Comments
Anderson8055 2-Apr-12 8:15am    
The answer is perfect and its working.. Thank you so much Murali!!
Muralikrishna8811 2-Apr-12 8:16am    
welcome
setInterval(click, 5000);

function click()
{
  $("#button id").click();
}


http://www.w3schools.com/jsref/met_win_setinterval.asp[^]

http://api.jquery.com/click/[^]
 
Share this answer
 
Comments
Anderson8055 12-Jun-12 8:56am    
excelent

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900