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

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

連續(xù)點(diǎn)擊”添加樣式“能讓其樣式在 .one和.two之間變換。

連續(xù)點(diǎn)擊”添加樣式“能讓其樣式在 .one和.two之間變換。連續(xù)點(diǎn)擊,讓兩個(gè)樣式交換出現(xiàn)。求大神指導(dǎo)。。。

正在回答

2 回答

<!DOCTYPE?HTML>
<html>
<head>
<meta?http-equiv="Content-Type"?Content="text/html;?charset=utf-8"?/>
<title>javascript</title>
<style?type="text/css">
body{font-size:12px;}
.one{color:red;}
.two{color:blue;}

</style>
</head>
<body>
??<h2?id="con"?class="one">JavaScript課程</H2>
??<input?type="button"?value="改變字體顏色"?id="obtn"?/>
??
??<script?type="text/javascript">
??var?oCon?=?document.getElementById("con");
??var?oBtn?=?document.getElementById("obtn");
??
??oBtn.onclick?=?function(){
????if?(oCon.className?==?"one")?
????{
??????oCon.className?=?"two";
????}
????else
????{
??????oCon.className?=?"one"
????}
??}

??</script>
</body>
</html>


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

可樂蓋 提問者

非常感謝!
2016-08-04 回復(fù) 有任何疑惑可以回復(fù)我~

function add(){

? ? ?var p1 = document.getElementById("p1");

? ? if(p1.className=="one")?

? ? ? ? ?p1.className="two";

? ? ? ? ?else

? ? ? ? ? p1.className="one";

? }


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

舉報(bào)

0/150
提交
取消

連續(xù)點(diǎn)擊”添加樣式“能讓其樣式在 .one和.two之間變換。

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

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

幫助反饋 APP下載

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

公眾號(hào)

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