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

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

顯示不了呢

?<form>

? <!--當(dāng)點(diǎn)擊相應(yīng)按鈕,執(zhí)行相應(yīng)操作,為按鈕添加相應(yīng)事件-->

? ? <input type="button" value="改變顏色" onclick="changecolor()" > ?

? ? <input type="button" value="改變寬高" onclick="changewidth()" >

? ? <input type="button" value="隱藏內(nèi)容" onclick="changehide()" >

? ? <input type="button" value="顯示內(nèi)容" onclick="changeshow()">

? ? <input type="button" value="取消設(shè)置" onclick="offset()">

? </form>

? <script type="text/javascript">

? var obj=document.getElementById("txt");

//定義"改變顏色"的函數(shù)

function changecolor(){

? ? //var obj=document.getElementById("txt");

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

? ? obj.style.background="#CCC";

}


//定義"改變寬高"的函數(shù)

function changewidth(){

? ? //var obj=document.getElementById("txt");

? ? obj.style.width="200px";

? ? ?obj.style.height="200px";

}


//定義"隱藏內(nèi)容"的函數(shù)

function changehide(){

? ? //var obj=document.getElementById("txt");

? ? obj.style.disply="none";

}


//定義"顯示內(nèi)容"的函數(shù)

function changeshow(){

? ? //var obj=document.getElementById("txt");

? ? obj.style.disply="block";

}


//定義"取消設(shè)置"的函數(shù)

function offset(){

? ? //var obj=document.getElementById("txt");

? ? var message=confirm("確認(rèn)要取消設(shè)置嗎");

? ? if(message==true){

? ? obj.removeAttribute('style');}

}



? </script>


正在回答

5 回答

隱藏/顯示內(nèi)容的那兩個函數(shù),obj.style.display,display這個地方單詞拼錯了。然后整體代碼運(yùn)行不了是因?yàn)槟阕詈笠欢文莻€取消設(shè)置的函數(shù)里面有個地方的符號是中文,你把那段代碼復(fù)制到控制臺試試就曉得了,會顯示invaid token的,我復(fù)制進(jìn)去試了下,是因?yàn)関ar message=confirm("確認(rèn)要取消設(shè)置嗎");這個地方末尾分號你是在中文輸入法下打出來的,導(dǎo)致后面都運(yùn)行不了。你仔細(xì)對比下其他地方的分號就能看出來了

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

? var message=confirm("確認(rèn)要取消設(shè)置嗎");你這個分號是中文的分號

你的display拼錯了

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

你這個應(yīng)該是那個全局變量的問題,方法外面的那個obj不能載函數(shù)里面用吧

0 回復(fù) 有任何疑惑可以回復(fù)我~
我這個是可以run的,你看一下,不清楚你的是什么顯示不了。

<!--當(dāng)點(diǎn)擊相應(yīng)按鈕,執(zhí)行相應(yīng)操作,為按鈕添加相應(yīng)事件-->
????<input?type="button"?value="改變顏色"?onclick="changecolor()">
????<input?type="button"?value="改變寬高"?onclick="changewidth()">
????<input?type="button"?value="隱藏內(nèi)容"?onclick="hidebody()">
????<input?type="button"?value="顯示內(nèi)容"?onclick="showbody()">
????<input?type="button"?value="取消設(shè)置"?onclick="cancel()">
??</form>
??<script?type="text/javascript">
//定義"改變顏色"的函數(shù)
function?changecolor(){var?change1=document.getElementById("txt");
change1.style.color="blue";}
//定義"改變寬高"的函數(shù)
function?changewidth(){var?change2=document.getElementById("txt");
change2.style.width="700px";}
//定義"隱藏內(nèi)容"的函數(shù)
function?hidebody(){var?change3=document.getElementById("txt");
change3.style.display="none";}
//定義"顯示內(nèi)容"的函數(shù)
function?showbody(){var?change4=document.getElementById("txt")
change4.style.display="block";}
//定義"取消設(shè)置"的函數(shù)
function?cancel()?{var?change5=confirm("是否取消設(shè)置?")
????if?(change5===true){
????????txt.removeAttribute("style");
????}
}


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

什么顯示不了?

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

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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