Sunday 13 April 2014

Auto Click after 4 Seconds Using Jquery

"Copy and Paste into Notepad and Save as .html and Run .... That's it  Thanks"


<!Doctype>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
</head>
<body>

<script>
var myVar;
$( document ).ready(function() {
    myVar=setTimeout(function(){
       $('#btn').trigger('click');
    },4000);
});
function myStopFunction(){
    clearTimeout(myVar);
}
function AutoCall(){
    alert("click is done...");
    clearTimeout(myVar);
}
</script>
<input type="button" onclick="AutoCall()" name="btn" id="btn" value="Don't Click here..." /> 
</body>
</html>

0 comments:

Post a Comment