onclick() 鼠標點擊時觸發事件
onmouseover() 鼠標進入此區域時觸發事件
onmouseout() 鼠標離開區域時觸發事件
<html>
<head>
<title> Mine </title>
</head>
<body>
<!--圖片的讀入以及跟隨鼠標狀態變化更改圖片-->
<img src = "wood.jpg" alt="tick" onmouseover="this.src='haha.jpg'" onmouseout="this.src='wood.jpg'"/>
<!--點擊按鈕時彈出消息-->
<input type="button" onclick="alert('You clicked the button!')" value="Click me"/>
</body>
</html>