日期:2014-05-17 浏览次数:20625 次
<html> <head> <title>CSS Example</title> </head> <body> <input type="button" onclick="start('abcdefg')" value="start" /> <input type="text" id="here" /> <script type="text/javascript"> function start(str1) { str=str1; len=str.length; i=0; dwrite(); } function dwrite() { document.getElementById("here").value=document.getElementById("here").value + str.charAt(i); if( i++ ==len ) { i=0; return true; } setTimeout("dwrite()",500); } </script> </body> </html>