<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>test-onfocus</title> <script type="text/javascript"> function message(){ alert("请在此输入姓名!"); } </script> </head> <body> <form> 姓名<input type="text" name="username" value="请输入姓名!" onfocus="message()"> </form> </body> </html>
为什么不会出现你们说的无限次弹框的问题啊