<script language=javascript>
function to_start(){
tm=window.setInterval('disp()',1000);
}
function disp(){
document.getElementById('n1').innerHTML += ' plus2net.com ';
}
</script>
setInteval('function_name', time-millisecond, lang);
In above code function_name is the name of the function we want to execute at an interval of time-millisecond ( time in mill second ) , optional element lang we can specify the code we want to execute. <html>
<head>
<title>Demo of SetInterval JavaScript function</title>
<script language=javascript>
function to_start(){
tm=window.setInterval('disp()',1000);
}
function disp(){
var dt= new Date();
var str=dt.toTimeString()
document.getElementById('n1').value=str;
}
</script>
</head>
<body >
<input type=text id=n1 >
<input type="button" name="btn" value="Start" onclick="to_start()";>
</body>
</html>
Above code we will only display the change in time but we can't stop it.
sathya | 26-03-2013 |
how to get a alert message with the reference of table data id using javascript? Note: if i clicked one row and the alert box will be triggered with that row information... can u please help me???? for this question? i need soon back |