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

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

點(diǎn)擊怎么沒反應(yīng)

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

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

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

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

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

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

? </form>

? <script type="text/javascript">

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

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

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

function color()

{

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

? ? txtchar.style.backgroundColor="#D1BDA1";

}

function top() {

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

? ? txtchar.style.heigth="200px";

}

function display()

{

?txtchar.style.display="none";

}


正在回答

5 回答

應(yīng)該是 onClick="" 那里的c沒大寫

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

function ?我換了個(gè)函數(shù)名就可以了 不知道是不是用了關(guān)鍵字命名函數(shù)

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

不對喲。我用你這個(gè)代碼跑的動(dòng)呢。你可能哪里出問題吧,那些標(biāo)簽有對應(yīng)嗎?這些代碼內(nèi)容基本沒啥問題。另onclick剛查了和測試一下也沒區(qū)分大小寫。。

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

<form>

<input type="text" id="con" value="Test"></input>

<input type="text" id="txt" value="Test"></input>

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

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

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

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

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

? </form>

? <script type="text/javascript">

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

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

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

function color()

{

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

? ? txtchar.style.backgroundColor="#D1BDA1";

}

function top() {

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

? ? txtchar.style.heigth="200px";

}

function display()

{

?txtchar.style.display="none";

}

</script>

以上是我測試代碼,可用。

你的代碼少了個(gè)<from>開頭,以及你的代碼少了個(gè)</script>結(jié)束

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

onClick C大寫

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

舉報(bào)

0/150
提交
取消
JavaScript入門篇
  • 參與學(xué)習(xí)       741427    人
  • 解答問題       9869    個(gè)

JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門

進(jìn)入課程

點(diǎn)擊怎么沒反應(yīng)

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

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

幫助反饋 APP下載

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

公眾號

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