Potluri wrote:

Hi,
 I'm using this method to store id's of checked checkboxes in array object
like
$("[EMAIL PROTECTED]'checkbox']:checked").each(
function()
{
 arrayName.push(this.id);
}
);

it works but above way takes .656 secs for storing in array object with 50
checkboxes. Is there a 1 line way to store id's in array object which
completes in 0.0... secs. similer to $("[EMAIL PROTECTED]'checkbox']:checked").attr("checked",false); which completes in 0.0... secs to unchecked checked checkboxes. Do any one of you have idea of how to make storing id into array object faster.

thanks in advance.

I would use the $.map method for such an operation:

var array = $.map($("[EMAIL PROTECTED]'checkbox']:checked").get(), function() {
    return this.id;
});


--Klaus

Reply via email to