久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      jquery怎么刪除多個元素中的class屬性

      刪除方法:1、利用class類選擇器獲取多個元素,語法“$(".class屬性值")”,會返回包含多個指定元素的jQuery對象;2、利用removeAttr()函數(shù)刪除獲取到的元素對象上的class屬性即可,語法“元素對象.removeAttr("class")”。

      jquery怎么刪除多個元素中的class屬性

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

      jquery刪除多個元素中class屬性的方法

      實現(xiàn)思想:

      • 利用class類選擇器獲取多個元素

      $(".class屬性值")

      會返回包含多個指定元素的jQuery對象

      • 利用removeAttr()方法刪除class屬性

      元素對象.removeAttr("class")

      實現(xiàn)代碼:

      <!DOCTYPE html> <html> 	<head> 		<meta charset="utf-8" /> 		<script src="./js/jquery-3.6.0.min.js"></script> 		<script> 			$(document).ready(function() { 				$("button").on("click", function() { 					$(".box").removeAttr("class"); 				}); 			}); 		</script> 	</head> 	<body>  		<div class="box">測試元素</div> 		<p class="box">測試元素</p> 		<span class="box">測試元素</span> 		<div class="box">測試元素</div> 		<br> 		<button>刪除多個元素中的class屬性</button> 	</body> </html>

      jquery怎么刪除多個元素中的class屬性

      【推薦學習:jQuery視頻教程、web前端視頻】

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