Jquery中判断是否含有某种属性
2016-08-23 09:41
148 查看
如<input superior="11" value='test'>
可以用typeof把$(this).attr("superior")转成类型与undefined相比较:
if(typeof($(this).attr("superior"))!="undefined")
$("#"+this.attributes.superior.nodeValue).attr('checked',true);
});
$("#id")的内容如下:
0:input#m1-7
context:document
length:1
selector:"#m1-7"
__proto__:Object[0]
使用get(0)可以获取input#m1-7
相关文章推荐
- jQuery 的 Div 标签滚动条属性及判断垂直滚动条是否到达底部
- jQuery 的 Div 标签滚动条属性及判断垂直滚动条是否到达底部
- JQuery 判断某个属性是否存在 hasAttr
- JQuery 判断某个属性是否存在 hasAttr
- jquery判断元素是否有某个属性
- jquery判断某个属性是否存在 hasAttr
- jQuery 的 Div 标签滚动条属性及判断垂直滚动条是否到达底部
- Jquery根据name属性值查找input的value值,且判断是否为空
- 判断请求头中是否含有某属性来判断是否是ajax请求
- iOS 判断字符串是否含有某种字符
- JavaScript判断远程图片是否存在,加载完成:onerror 属性- & jQuery实现(如果因为网络或图片的原因发生异常,则显示该图片)~
- 判断JS对象是否拥有某种属性的两种方式
- 用JQuery 判断某个属性是否存在hasAttr的解决方法
- JQuery如何判断标签指定属性是否存在
- JavaScript判断远程图片是否存在,加载完成:onerror 属性- & jQuery实现(如果因为网络或图片的原因发生异常,则显示该图片)~
- 通过length属性判断jquery对象是否存在
- 判断请求头中是否含有某属性来判断是否是ajax请求
- 判断JS对象是否拥有某种属性的两种方式
- 关于jquery版本为1.6+使用checkbox的checked属性来判断一个checkbox是否被选中问题
- Jquery判断元素是否隐藏:display属性状态值