第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

為何鼠標(biāo)移到標(biāo)簽上不變色

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title> 鼠標(biāo)經(jīng)過事件 </title>

<script type="text/javascript">

? ? function message(){

? confirm("請輸入密碼后,再單擊確定!");?

? ? ?}

? ? ?function click(){

? ? ? ? ?var mychar =document.getElementsByName("title")[0];

? ? ? ? ?mychar.style.color="red";

? ? ?}

</script>

</head>

<body>

<form>

<label name="title" style="color:balck">密碼:</label><input name="password" type="password" onmounseover="click" >

<input name="確定" type="button" value="確定" onmouseover="message()"/>


</form>

</body>

</html>


正在回答

4 回答

<!DOCTYPE?HTML>
<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>
<title>?鼠標(biāo)經(jīng)過事件?</title>
<script?type="text/javascript">
????function?message(){
??confirm("請輸入密碼后,再單擊確定!");?
?????}
?????function?colChange(){
????????var?mychar?=document.getElementsByName("title")[0];
????????mychar.style.color="red";
?????}
</script>
<style>
??.form1{width:300px;height:300px;margin:0?auto;test-align:center;background-color:#003;}
??.form2{width:200px;height:200px;margin:0?auto;test-align:center;background-color:#666;}
</style>
</head>
<body>
<!--<form?class="form1">
<label?name="title"?style="color:black">密碼:</label>
<label?name="title"?style="color:black">密碼:</label>
<input?name="password"?type="password"?onmounseover="colChange()"/>
<input?name="確定"?type="button"?value="確定"?onmouseover="message()"/>
</form>-->
<form?class="form2">
<label?name="title"?style="color:black">密碼:</label>
<label?name="title"?style="color:black">密碼:</label>
<input?name="password"?type="password"?onmouseover="colChange()"/>
<input?name="確定"?type="button"?value="確定"?onmouseover="message()"/>
</form>
</body>
</html>


0 回復(fù) 有任何疑惑可以回復(fù)我~
<!DOCTYPE?HTML>

<html>

<head>

<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>

<title>?鼠標(biāo)經(jīng)過事件?</title>

<script?type="text/javascript">

????function?message(){

??confirm("請輸入密碼后,再單擊確定!");?

?????}

?????function?putate(){

?????????var?mychar?=document.getElementById("title");

?????????mychar.style.backgroundColor="red";
?????}

</script>

</head>

<body>

<form>

<p>密碼:</p>
<input?id="title"?name="password"?type="password"?onmouseover="putate()"/>
?
<input?name="確定"?type="button"?value="確定"?onmouseover="message()"/>


</form>

</body>

</html>

你要的應(yīng)該是這種效果吧

0 回復(fù) 有任何疑惑可以回復(fù)我~

<script type="text/javascript">

? ? function message(){

? confirm("請輸入密碼后,再單擊確定!");?

? ? ?}

? ? ?function clicks(){

? ? ? ? ?var mychar = document.getElementsByName("title")[0];

? ? ? ? ?mychar.style.color="red";

? ? ?}

</script>

<form>

<label name="title" style="color:black">密碼:</label>

<label name="title" style="color:black">密碼:</label>

<input name="password" type="password" onmouseover="clicks()" >

<input name="確定" type="button" value="確定" onmouseover="message()"/

</form>

經(jīng)測試沒有問題?

你的問題

  1. click屬性名不可當(dāng)作函數(shù)名來用 我改成clicks

  2. 你用到的“getElementsByName”不能單個(gè)使用

    看例子:http://www.w3school.com.cn/jsref/met_doc_getelementsbyname.asp

    我復(fù)制了一個(gè)就可以獲取到第一個(gè)name值為title的元素了

  3. 你這里的問題?onmounseover="click" ?調(diào)用函數(shù)得有括號

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

一只特立獨(dú)行的doge

哥們,我就懵了逼了,我照著你寫的,一模一樣。。。我的就不行,你的就行,能不能幫我看看??!一臉大寫的懵逼吧。form1是我的,form2是你的。代碼貼不出來,我貼樓下!你看看
2016-04-20 回復(fù) 有任何疑惑可以回復(fù)我~

style="color:balck" ? 你這個(gè)black ?寫錯了 ? ?這里和你的程序沒有關(guān)系

onmounseover="click" ? 這里click后面沒有加括號?

input好像不會觸發(fā)?onmounseover 事件 ,所以就算程序都寫對也沒有用


1 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為何鼠標(biāo)移到標(biāo)簽上不變色

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號