prop()

    prop: function( elem, name, value ) {
var ret, hooks, notxml,
nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes
//标签不存在或者是文本、属性、注释节点
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
} notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) {
// 属性中的for与class涉及到保留字,所以通过propFix分别对应到htmlFor和className
// propFix: {
// "for": "htmlFor",
// "class": "className"
// }
name = jQuery.propFix[ name ] || name;
// propHooks: {
// tabIndex: {
// get: function( elem ) {
// return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
// elem.tabIndex :
// -1;
// }
// }
// }
//hasAttribute IE9+
//rfocusable 用于检测可以处于焦点的表单元素正则
hooks = jQuery.propHooks[ name ];
} if ( value !== undefined ) {//赋值
return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
ret :
( elem[ name ] = value ); } else {//取值
return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
ret :
elem[ name ];
}
}

removeProp()

    removeProp: function( name ) {
return this.each(function() {
delete this[ jQuery.propFix[ name ] || name ];
});
}

最新文章

  1. Js添加消息提示数量
  2. .NET ORM 的 “SOD蜜”--零基础入门篇
  3. NSFileManeger
  4. 秀才提笔忘了字:javascript使用requestAnimationFrame实现动画
  5. qwt 6.1.0集成进Qt creator 2.8.1步骤
  6. js EasyUI前台 价格=数量*单价联动的实现
  7. thinkphp T方法
  8. SQL - 删掉数据库
  9. IZ65534: 'JAVA.LANG.CLASSFORMATERROR' ERROR FOR A VALID IDENTIFIER
  10. 【百度地图API】获取行政区域的边界
  11. 2015年最棒的10个 JavaScript 框架
  12. NPIO 导出Execl
  13. 在eclipse上使用github,向github中提交项目
  14. winform webbrowser如何强制使用ie11内核?
  15. vue-router query 传对象需要JSON.stringify()转化
  16. 搭建apache本地服务器·Mac
  17. linux 通过pid 寻找程序路径的最简单命令(pwdx)
  18. python之查询指定目录下的最新文件
  19. [OpenCV-Python] OpenCV 中的图像处理 部分 IV (一)
  20. Android 使用开源库StickyGridHeaders来实现带sections和headers的GridView显示本地图片效果

热门文章

  1. gzhu 2013 Good Sequence 解题报告
  2. 《UML和模式应用》读书笔记(一)
  3. 转C++的一点点
  4. Linux服务:使用Supervisor管理进程
  5. 简单三步快速学会使用Mybatis-Generator自动生成entity实体、dao接口以及mapper映射文件(postgre使用实例)
  6. ftp连接服务器失败||或者Xshell链接错误:Could notconnect to '192.168.18.128' (port 22): Connection failed
  7. 构建一个简单的Angular工程
  8. android 自动生成jni C语言头文件
  9. linux学习 三 redhat
  10. nohup 命令 print 不能实时输出至 nohup.out