W3School TIY
编辑您的代码:
<html> <head> <script type="text/javascript"> function disp_alert() { alert("我是一个消息框!") } </script> </head> <body> <input type="button" onclick="disp_alert()" value="显示消息框" /> </body> </html>
查看结果: