当前第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中html乱码怎么办
jQuery如何使用css方法让按钮不可点击
jQuery 如何判断 是否相等
input输入框用jQuery怎么写失去焦点事件
jQuery中prop什么意思
详解jQuery中extend()和jQuery.fn.extend()的区别
jQuery中find()与children()的区别是什么?
如何解决jQuery $.post 乱码问题
jQuery 轮播图怎么写
jQuery 怎么写if
更多相关阅读请进入《jQuery》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » jquery不等于属性选择器是什么