调试运行
<html> <head> <title>在指定的时间调用一次函数</title> <script language="javascript"> <!-- function showtxt(){ a = txt.value; txt.value = a + "*"; } setTimeout("showtxt()",2000); //--> </script> </head> <body> <input type="text" id="txt"> </body> </html>