久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      javascript怎么刪除css樣式

      js刪除樣式的方法:1、使用setAttribute()方法,語(yǔ)法“對(duì)象.setAttribute("屬性名稱","")”;2、使用removeProperty()方法,語(yǔ)法“對(duì)象.removeProperty("屬性名稱")”。

      javascript怎么刪除css樣式

      本教程操作環(huán)境:windows7系統(tǒng)、javascript1.8.5版、Dell G3電腦。

      javascript刪除css樣式

      1、使用setAttribute方法清除樣式

      <p id="p" style="color:#FF0000">hello world<p>  <button onclick="myFunction()">點(diǎn)擊按鈕,去除樣式</button>  <script> 	function myFunction() { 		document.getElementById("p").setAttribute('style', ''); 	} </script>

      效果圖:

      javascript怎么刪除css樣式

      2、使用removeProperty方法

      <p id="p" style="color:palevioletred;">hello world<p>  <button onclick="myFunction()">點(diǎn)擊按鈕,去除樣式</button>  <script> 	function myFunction() { 		document.getElementById("p").style.removeProperty("color"); 	} </script>

      效果圖:

      javascript怎么刪除css樣式

      【推薦學(xué)習(xí):javascript高級(jí)教程】

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)