想要得到div下面的拥有class属性的span,不管理class是什么 有多少个
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="jie">
<span>sdfds</span>
<span class="try try21">sdfds</span>
<span>sdfds</span>
<span class="try2 try22">sdfds</span>
<span>sdfds</span>
<span class="try3 ">sdfds</span>
<span class="try4 sdfsd44">sdfds</span>
</div>
<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script>
console.log($("#jie span").hasClass());
</script>
</body>
</html>
慕斯王
幕布斯6054654
撒科打诨
相关分类