1、Get the attribute, check the value

var attr = $(this).attr('name');

// For some browsers, `attr` is undefined; for others, `attr` is false. Check for both.
if (typeof attr !== typeof undefined && attr !== false) {
// Element has this attribute
}

2、Native JavaScript has a way

$(this)[0].hasAttribute("name");

jQObject[0].hasAttribute("name");

3、Filter the selection

$(this).is('[name]');

$(this).filter("[name='choice']");

最新文章

  1. IntelliJ IDEA14.1中java项目Maven中没有配置JDK时的问题
  2. ios Unit test 入门书籍推荐
  3. 转载 Servlet3.0中使用注解配置Servle
  4. JS运动基础(三) 弹性运动
  5. 浏览器对象模型(BOM,Browser Object Model)
  6. QTP获取系统时间并自定义格式
  7. iOS xcode8提交 iOS10 “此构建版本无效” (已解决)
  8. 【Android Studio使用教程 7】AndroidStudio问题汇总
  9. Linux3.4内核的基本配置和编译
  10. 获取不变的UDID-b
  11. linux中ctrl+z、ctrl+d和ctrl+c的区别
  12. Android dialog 问题
  13. spring整合redis客户端及缓存接口设计(转)
  14. hdoj 1506&&1505(City Game) dp
  15. easyUI日期框返回到月份,选择日期也只到月份
  16. 海量数据挖掘MMDS week4: 推荐系统之隐语义模型latent semantic analysis
  17. mvc路由报错
  18. bootstrap学习: 折叠插件和面板
  19. Approx Analytic Arealight
  20. centos7 tomcat9

热门文章

  1. 1 background(复合属性)与font(复合属性) 2 行内块的间距问题 3 行内元素的margin 4 清除浮动 5定位的元素的层级 6 Border-radius: 边框半径
  2. mac远程桌面连接windows 8.1 update,提示: 远程桌面连接无法验证您希望连接的计算机的身份
  3. 如何在.NET上处理二维码
  4. 女生的最爱,装饰品。WPF也有,Adorner。(上海晒衣服理念)
  5. C#开发EyeLink眼动仪的实验程序
  6. JavaScript实现TwoQueues缓存模型
  7. [Unity3D]自己动手重制坦克舰队ArmadaTank(2)从碰撞说起
  8. Castle中AdditionalInterfaces用法介绍
  9. Android开发学习之路-图片颜色获取器开发(1)
  10. The currently selected variant "arm-debug" uses split APKs, but none of the 1 split apks are compatible with the current device with density "213" and ABIs "x86".