課程
/前端開(kāi)發(fā)
/JavaScript
/JavaScript入門(mén)篇
obj.removeAttribute()什么意思?有什么作用?
2018-02-07
源自:JavaScript入門(mén)篇 4-1
正在回答
就是清除之前設(shè)置所有的樣式,arr.removeAttribute('style')
????<input?type="button"?value="改變顏色"?onclick="co()"> ????<input?type="button"?value="改變寬高"??onclick="wd()"> ????<input?type="button"?value="隱藏內(nèi)容"??onclick="cn()"> ????<input?type="button"?value="顯示內(nèi)容"??onclick="cx()"> ????<input?type="button"?value="取消設(shè)置"??onclick="qv()"> ??</form> <script> ????var?arr=document.getElementById("txt"); ????function?co()?{ ????????arr.style.color='red'; ????????arr.style.backgroundColor='blue'; ????} ????function?wd()?{ ????????arr.style.width="500px"; ????????arr.style.height="800px"; ????} ????function?cn()?{ ????????arr.style.display='none'; ????} ????function?cx()?{ ????????arr.style.display='block'; ????} ????function?qv()?{ ????????var?open=confirm("是否取消設(shè)置?") ????????if(open==true){ ????????arr.removeAttribute('style') ????????} ????}
舉報(bào)
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門(mén)
3 回答removeAttribute
2 回答removeAttribute()
1 回答removeAttribute()
4 回答removeAttribute
1 回答removeAttribute
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2018-02-07
就是清除之前設(shè)置所有的樣式,arr.removeAttribute('style')