相關(guān)資訊
- 《戰(zhàn)國(guó)無(wú)雙4-2》怎么換服裝?戰(zhàn)國(guó)無(wú)
- 關(guān)于責(zé)任的名言警句大全
- 《戰(zhàn)國(guó)無(wú)雙4-2》PC版如何聯(lián)機(jī)? 戰(zhàn)
- 戰(zhàn)國(guó)無(wú)雙4-2技能覺(jué)醒牛逼嗎 全新
- 《戰(zhàn)國(guó)無(wú)雙4-2》手柄無(wú)效怎么解決
- 戰(zhàn)國(guó)無(wú)雙4-2如何設(shè)置語(yǔ)言 戰(zhàn)國(guó)無(wú)雙
- 戰(zhàn)國(guó)無(wú)雙4-2怎么樣跳過(guò)進(jìn)入開(kāi)場(chǎng)動(dòng)畫(huà)
- 什么是應(yīng)屆生畢業(yè)生
- 應(yīng)屆生簡(jiǎn)歷自我評(píng)價(jià)
- 應(yīng)屆生簡(jiǎn)歷怎么寫(xiě)
本類(lèi)常用軟件
-
福建農(nóng)村信用社手機(jī)銀行客戶端下載下載量:584204
-
Windows優(yōu)化大師下載量:416898
-
90美女秀(視頻聊天軟件)下載量:366961
-
廣西農(nóng)村信用社手機(jī)銀行客戶端下載下載量:365699
-
快播手機(jī)版下載量:325855
每日一囧
Js方法
<head>
<script type="text/javascript">
function Doit() {
// 獲得一個(gè)input的數(shù)組,需要遍歷
var inputs = document.getElementsByTagName_r("input");
for (var i = 0; i < inputs.length; i++) {
// 如果是文本控件
if (inputs[i].type == "text") {
// 前面有on——
inputs[i].onfocus = function () {
// 通過(guò)this直接獲取觸發(fā)的元素
this.style.backgroundColor = "yellow";
};
inputs[i].onblur = function () {
this.style.backgroundColor = "white";
};
}
}
}
</script>
</head>
<body onload="Doit()">
<input id="Text1" type="text" />
<input id="Text2" type="text" />
<input id="Text3" type="text" />
<input id="Button1" type="button" value="button" />
</body>
</html>
Jquery方法
<head>
<script src="jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
// 不需要遍歷
$('input[type=text]').click(function () {
// this前面要加dollar符
$(this).css("backgroundColor","yellow");
}).blur(function () { $(this).css("backgroundColor","white");});
// blur前面沒(méi)有on
});
</script>
</head>
<body>
<input id="Text1" type="text" />
<input id="Text2" type="text" />
<input id="Text3" type="text" />
<input id="Button1" type="button" value="button" />
</body>
</html>
<head>
<script type="text/javascript">
function Doit() {
// 獲得一個(gè)input的數(shù)組,需要遍歷
var inputs = document.getElementsByTagName_r("input");
for (var i = 0; i < inputs.length; i++) {
// 如果是文本控件
if (inputs[i].type == "text") {
// 前面有on——
inputs[i].onfocus = function () {
// 通過(guò)this直接獲取觸發(fā)的元素
this.style.backgroundColor = "yellow";
};
inputs[i].onblur = function () {
this.style.backgroundColor = "white";
};
}
}
}
</script>
</head>
<body onload="Doit()">
<input id="Text1" type="text" />
<input id="Text2" type="text" />
<input id="Text3" type="text" />
<input id="Button1" type="button" value="button" />
</body>
</html>
Jquery方法
<head>
<script src="jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
// 不需要遍歷
$('input[type=text]').click(function () {
// this前面要加dollar符
$(this).css("backgroundColor","yellow");
}).blur(function () { $(this).css("backgroundColor","white");});
// blur前面沒(méi)有on
});
</script>
</head>
<body>
<input id="Text1" type="text" />
<input id="Text2" type="text" />
<input id="Text3" type="text" />
<input id="Button1" type="button" value="button" />
</body>
</html>
熱門(mén)評(píng)論
最新評(píng)論