實例 當滑鼠指標移到映像以外時執行一段JavaScript:登入後複製瀏覽器支援IEFirefoxChromeSafariOpera所有主流瀏覽器都支援onmouseout 屬性。 定義和用法onmouseout 屬性在滑鼠指標移動到元素外時觸發。 註解:onmouseout 屬性不適用下列元素:、、、、、 、、、、<style> 或<title>。 </p><p style="margin: 0px; padding: 0px; border: 0px; font-size: 18px; color: rgb(63, 63, 63); font-family: 微软雅黑; white-space: normal; background-color: rgb(253, 252, 248);">HTML 4.01 與 HTML5 之間的差異</p><p>無。 </p><p style="margin: 0px; padding: 0px; border: 0px; font-size: 18px; color: rgb(63, 63, 63); font-family: 微软雅黑; white-space: normal; background-color: rgb(253, 252, 248);">語法</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:js;toolbar:false"><element onmouseout="script"></pre><div class="contentsignin">登入後複製</div></div><p style="margin: 25px 0px 0px; padding: 0px; border: 0px; font-size: 16px; color: rgb(0, 0, 0); font-family: PingFangSC-Regular, Verdana, Arial, 微软雅黑, 宋体; white-space: normal; background-color: rgb(253, 252, 248);">屬性值</p><table><tbody><tr class="firstRow"><td width="100" valign="top" style="word-break: break-all;">#值</td><td width="1009" valign="top" style="word-break: break-all;">描述</td></tr><tr><td width="100" valign="top" style="word-break: break-all;">script</td><td width="1009" valign="top" style="word-break: break-all;">onmouseout 發生時執行的腳本。 </td></tr></tbody></table><p style="box-sizing: border-box; font-family: Arial; font-weight: 100; line-height: 26px; color: rgb(54, 46, 43); margin: 20px 0px 0px; font-size: 12px; padding: 0px; white-space: normal; border: 0px; background-color: rgb(249, 249, 249);">支援該<a href="http://www.php.cn/js/js-jspopular-guide-event.html" target="_blank">事件</a>的HTML 標籤:</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false"><a>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>, <body>, <button>, <caption>, <cite>, <code>, <dd>, <dfn>, <p>, <dl>, <dt>, <em>, <fieldset>, <form>, <h1> to <h6>, <hr>, <i>, <img>, <input>, <kbd>, <label>, <legend>, <li>, <map>, <ol>, <p>, <pre>, <samp>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>, <th>, <thead>, <tr>, <tt>, <ul>, <var></pre><div class="contentsignin">登入後複製</div></div><p style="box-sizing: border-box; font-family: Arial; font-weight: 100; line-height: 26px; color: rgb(54, 46, 43); margin: 20px 0px 0px; font-size: 12px; padding: 0px; white-space: normal; border: 0px; background-color: rgb(249, 249, 249);">支援該事件的JavaScript 物件:</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:js;toolbar:false">layer, link</pre><div class="contentsignin">登入後複製</div></div><p style="box-sizing: border-box; font-family: 微软雅黑; font-weight: 100; line-height: 26px; color: rgb(54, 46, 43); margin: 0px; font-size: 14px; padding: 0px; white-space: normal; border: 0px; background-color: rgb(249, 249, 249);">實例</p><p>在下面的例子中,我們將在滑鼠指標移出圖像時顯示一個對話框:</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false"><img src="/i/example_mouse2.jpg" alt="mouse" onmousemove="alert('您的鼠标刚才离开了图片!')" /></pre><div class="contentsignin">登入後複製</div></div>