課程
/前端開發
/JavaScript
/JavaScript入門篇
obj.removeAttribute()什么意思?有什么作用?
2018-02-07
源自:JavaScript入門篇 4-1
正在回答
就是清除之前設置所有的樣式,arr.removeAttribute('style')
????<input?type="button"?value="改變顏色"?onclick="co()"> ????<input?type="button"?value="改變寬高"??onclick="wd()"> ????<input?type="button"?value="隱藏內容"??onclick="cn()"> ????<input?type="button"?value="顯示內容"??onclick="cx()"> ????<input?type="button"?value="取消設置"??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("是否取消設置?") ????????if(open==true){ ????????arr.removeAttribute('style') ????????} ????}
舉報
JavaScript做為一名Web工程師的必備技術,本教程讓您快速入門
2 回答removeAttribute()
1 回答removeAttribute
4 回答removeAttribute
1 回答removeAttribute()
3 回答removeAttribute
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-02-07
就是清除之前設置所有的樣式,arr.removeAttribute('style')