jquery中prop()方法和attr()方法的区别

tofixed: 四舍五入为指定小数位数的数字html

tofixed(number)  tofixed(2) 意四舍五入的位数为两位ide

 jQuery 1.6 开始新增了一个方法 prop();spa

1.添加属性名称该属性就会生效应该使用prop();
2.是有true,false两个属性使用prop();
3.其余则使用attr();
orm

注:根据官方的建议具备 true 和 false 两个属性的属性,如 checked, selected 或者 disabled 使用prop(),其余的使用 attr()htm


http://www.cnblogs.com/zhwl/p/3520162.htmlblog

相关文章
相关标签/搜索