W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <script type="text/javascript"> function clickButton() { document.getElementById('button1').click() } function alertMsg() { alert("Button 1 was clicked!") } </script> </head> <body onload="clickButton()"> <form> <input type="button" id="button1" onclick="alertMsg()" value="Button 1" /> </form> </body> </html>