當前位置:軟件學堂 > 資訊首頁 > 網(wǎng)絡(luò)編程 > DIV+CSS > onmouseover事件

onmouseover事件

2012/9/20 15:42:39作者:佚名來源:網(wǎng)絡(luò)

移動端

onmouseover事件

onmouseover事件與onmouseout事件是我們在做鼠標特效果常常用到的二個事件,當鼠標移入或移開時顯示效果或做數(shù)據(jù)處理

定義:當鼠標光標信息停在某窗體元素上時,就會觸發(fā)onMouseOver事件

語法:

onmouseover=”點擊時要執(zhí)行的腳本"

支持標簽:

<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 的內(nèi)容拷貝到 Field2 中:

<br />

<button onclick="document.getElementById('field2').value=

document.getElementById('field1').value">Copy Text</button>

</body>

</html>

標簽: onmouseover  事件