jquery 判断checkbox是否选中

WBOY
Release: 2016-06-01 09:54:48
Original
1282 people have browsed it
第一种方法:
Copy after login
if ($("#checkbox-id").get(0).checked) { }
Copy after login
第二种方法:
Copy after login
if($('#checkbox-id').is(':checked')) { }
Copy after login
第三种方法:
Copy after login
if ($('#checkbox-id').attr('checked')) { }
Copy after login

实例:

本实例获取所有checkbox的选中值。

php mysql jquery java   
Copy after login

在线运行

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!