Home > Web Front-end > JS Tutorial > Introduction to jquery traversing checkbox_jquery

Introduction to jquery traversing checkbox_jquery

WBOY
Release: 2016-05-16 16:58:54
Original
947 people have browsed it

checkbox Select all Cancel
$("#ChkAll").click(function(){
$("#divContent input[type=' checkbox']").attr("checked",$(this).attr("checked"));
});

Get the value of the selected checkbox:
var arrChk=$("input[name='chk_list'][checked]");
$ (arrChk).each(function(){
            window.alert(this.value);                                                                                             

$("#checkbox_id").attr("checked"); //Get the status of a CheckBox (whether it is selected, return true/false)

$("#checkbox_id").attr("checked",true); //Set the status of a CheckBox to checked (checked=true)

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template