源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> </head> <body> <h1>我的第一個 JavaScript</h1> <p> JavaScript 能夠對事件作出反應。比如對按鈕的點擊: </p> <button type="button" onclick="alert('歡迎!')">點我!</button> </body> </html>
運行結果