How to Set Some Time Delay for Function Method Execution with SetTimeout Function c#
$(function() { setTimeout("ShowTime()", 1000); }); |
<html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1"> <title>jQuery display current time on webpage</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script> <script type="text/javascript"> $(function() { setTimeout("ShowTime()", 1000); }); function ShowTime() { var dt = new Date(); $("#lblTime").html(dt.toLocaleTimeString()); setTimeout("ShowTime()", 1000); // Here 1000(milliseconds) means one 1 Sec } </script> </head> <body> <form id="form1"> <div> jQuery Display time second by second. <label id="lblTime" style="font-weight: bold"></label> </div> </form> </body> </html> |
jQuery Display time second by second. |
Download
No comments:
Post a Comment