<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hello World</title>
</head>
<body>
<form id="form1" method="post">
<input type="submit" value="提交" onclick="alert('hello world')" />
</form>
</body>
</html>
<!DOCTYPE html> 宣告 HTML5 文件型別。meta charset=utf-8 確保中文正常顯示。onclick 事件,彈出 JavaScript 警示視窗。