滑鼠指標移出 HTML 元素時執行指令碼?
滑鼠指標移出元素時,onmouseout 屬性被觸發。你可以嘗試以下程式碼來實現 onmouseout 屬性 -
示例
<!DOCTYPE html> <html> <body> <h3 id = "myid" onmouseout = "mouseOut()"> This is demo heading. </h3> <p>Click above and then release.</p> <script> function mouseOut() { document.getElementById("myid").style.color = "red"; } </script> </body> </html>
廣告