JQ中的attr和prop方法
2016-07-26 18:04
330 查看
啥也不说了,注意坑,如果你在使用attr的时候发现明明在行间已经加上了该属性但实际却无法生效那就尝试一下prop吧!贴一张官方推荐的是使用attr还是prop的表格:
Attribute/Property | .attr() | .prop() |
---|---|---|
accesskey | √ | |
align | √ | |
async | √ | √ |
autofocus | √ | √ |
checked | √ | √ |
class | √ | |
contenteditable | √ | |
draggable | √ | |
href | √ | |
id | √ | |
label | √ | |
location ( i.e. window.location ) | √ | √ |
multiple | √ | √ |
readOnly | √ | √ |
rel | √ | |
selected | √ | √ |
src | √ | |
tabindex | √ | |
title | √ | |
type | √ | |
width ( if needed over .width()) | √ |
相关文章推荐
- linux中如何查看日志中某个异常出现的次数
- sqoop导出工具
- linux基础命令
- docker 的安装
- 【POJ】River Hopscotch
- linux兴趣小组暑假第二次讲座总结
- opengl中TGA图像加载技术
- Linux学习笔记4linux的文件系统
- Linux 编程中的API函数和系统调用的关系【转】
- OpenGL基础教程(2):着色器
- Linux 中open系统调用实现原理【转】
- elk 架构
- elk 架构
- elk 架构
- 高可用集群技术之heartbeat应用案例详解(二)
- linux中动态库和静态库
- 提高Linux工作效率的十大bash技巧
- nginx用户认证
- Session监听统计网站的在线人数HashSet
- linux 基础学习入门 3