jQuery 获取复选框checked属性值

我们平常获取属性值一般都是用attr() 

但是attr()也有不好使的时候  例如获取复选框checked的属性值

这是我们可以使用另一个jQuery的方法prop()

$('input').prop('checked')

//true = >选中

//false =>未选中

另外:这只是其中一个判断复选框是否被选中的方法

猜你喜欢

转载自blog.csdn.net/yuyezhilv/article/details/80250667
今日推荐