<html> <head> <title>js输入对话框</title> </head> <body> <script language="javascript"> <!-- age = prompt("请输入你的年龄:", "20"); if (age != null) { alert("你今年" + age + "岁了!"); } else { alert("你按了[取消]按钮"); } //--> </script> </body> </html>
时间: 2024-11-05 16:07:48