fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> <script> function greeting(){ alert("Welcome " + document.forms["frm1"]["fname"].value + "!") } </script> </head> <body> 你的名字是:<br> <form name="frm1" action="tryjsref_form_onsubmit.htm" onsubmit="greeting()"> <input type="text" name="fname"> <input type="submit" value="提交"> </form> </body> </html>
运行结果