当前第2页 返回上一页
以下代码展示获取ID不等于cheese的所有元素。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <!DOCTYPE html>
<html>
<head>
<script src= "http://code.jquery.com/jquery-1.11.1.min.js" ></script>
</head>
<body>
<div id= "eggs" ></div>
<div id= "ham" ></div>
<div id= "cheese" ></div>
<script>
var n = $( "[id!='cheese']" ).length;
alert(n);
</script>
</body>
</html>
|
以下代码选择所有input的名称不为me的输入框元素。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <html>
<head>
<script src= "http://code.jquery.com/jquery-1.11.1.min.js" ></script>
<script type= "text/javascript" >
$(document).ready( function (){
$( "input[name!='me']" ).next().text( " changed" );
});
</script>
</head>
<body>
<div>
<input type= "radio" name= "you" value= "A" />
<span>data</span>
</div>
<div>
<input type= "radio" name= "me" value= "B" />
<span>data</span>
</div>
<div>
<input type= "radio" name= "me" value= "C" />
<span>data</span>
</div>
</body>
</html>
|
以上就是jquery不等于属性选择器是什么的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
jQuery怎么获取星期几
javascript中stop方法的作用是什么
怎么用jQuery做弹出窗口
jQuery有哪些属性选择器
两分钟了解jQuery与javascript、js 三者间的区别
追加的html代码使用jQuery的click事件无效
jQuery版本号如何隐藏
jQuery怎么去除css样式?
jQuery取值如何取整
浅谈查看bootstrap和jQuery版本对应关系的方法
更多相关阅读请进入《jQuery》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » jquery不等于属性选择器是什么