码迷,mamicode.com
首页 > Web开发 > 详细

jquery 属性

时间:2015-09-07 12:38:55      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:

属性方法,都是可以获取;可以设置,设置的话,都可以通过function来设置

 

1、attr():可以同时设置多个;可以通过函数设置

2、removeAttr()

3、prop():获取在匹配的元素集中的第一个元素的属性值:$("input[type=‘checkbox‘]").prop("checked");

设置:把所有的checkbox都disable

$("input[type=‘checkbox‘]").prop({
  disabled: true
});

可以通过函数设置;

4、removeProp():用来删除由.prop()方法设置的属性集

5、addClass():可以添加多个

6、removeClass():删除,function(index, classname);可删除多个

7、toggleClass():切换,对于特定功能;只能切换一个  

8、.html():取得第一个匹配元素的html内容; function(index, html)

9、.text():跟html()的样式类似

10、.val()

 

jquery 属性

标签:

原文地址:http://www.cnblogs.com/wang-jing/p/4788372.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!