日期:2014-05-16 浏览次数:20324 次
<html> <head> <tilte></title> <script type="text/JavaScript"> function showHello() var count=parseInt(document.getElementById("txtCount").value); for (var i=0;i<count;i++) { document.write("Hello World"); } </script> </head> <body> 请输入要显示的Hello World的次数:<input type="text" id="txtCount"/><br/> <input type="button" onclick="showHello()" value="点击显示吧" /> </body> </html>
<html> <head> <tilte>dgdsg</title> <script type="text/javascript"> function dotest(){ var value = document.getElementById("txtCount").value; for(var i=0;i<value;i++){ alert("输入数据"); } } </script> </head> <body> 请输入要显示的Hello World的次数:<input type="text" id="txtCount"/><br/> <input type="button" onclick="dotest()" value="点击显示吧" /> </body> </html>