Joke Collection Website - Blessing messages - How to get the values ??of multiple check boxes in jquery?

How to get the values ??of multiple check boxes in jquery?

You can refer to the following code:

$(document).ready(function(){

varchecked=[];

$("#submitButton").click(function(){

$('input:checkbox:checked').each(function(){

checked.push($ (this).val());

});

alert(checked);

});

}) ;

Extended information:

jquery reference function

$("Element name").html("new?stuff" );?Set content for an element?

$("Element Name").removeAttr("Attribute Name")?Delete the specified attribute and the value of the attribute for an element?

< p>$("Element Name").removeClass("class")?Remove the specified style from an element?

$("Element Name").text();?Get the text of the element ?

$("Element Name").text(value);?Set the text value of the element to value

Baidu Encyclopedia-jQuery