实例 当鼠标指针移动到图像之外时执行一段 JavaScript:Salin selepas log masuk浏览器支持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">Salin selepas log masuk</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">Salin selepas log masuk</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">Salin selepas log masuk</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">Salin selepas log masuk</div></div>