2012-09-20 来源:网络
onmouseover事件
onmouseover事件与onmouseout事件是我们在做鼠标特效果常常用到的二个事件,当鼠标移入或移开时显示效果或做数据处理
定义:当鼠标光标信息停在某窗体元素上时,就会触发onMouseOver事件
语法:
onmouseover=”点击时要执行的脚本"
支持标签:
<a>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>, <body>, <button>, <caption>, <cite>, <code>, <dd>, <dfn>, <div>, <dl>, <dt>, <em>, <fieldset>, <form>, <h1> to <h6>, <hr>, <i>, <img>, <input>, <kbd>, <label>, <legend>, <li>, <map>, <object>, <ol>, <p>, <pre>, <samp>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>, <th>, <thead>, <tr>, <tt>, <ul>, <var>支持的JavaScript对象:
layer, link
举例说明:
<html>
<body>
Field1: <input type="text" id="field1" value="Hello World!">
<br />
Field2: <input type="text" id="field2">
<br /><br />
点击下面的按钮,把 Field1 的内容拷贝到 Field2 中:
<br />
<button onclick="document.getElementById('field2').value=
document.getElementById('field1').value">Copy Text</button>
</body>
</html>