[jQuery] Re: what is the best way to do this

2008-10-15 Thread ricardobeat
$('.profile1,.profile3').addClass('selected') just turn the names or numbers into vars: var selection = []; $('form checkbox:checked').each(function(){ selection.push('.'+this.whateverValue); }); // now selection == ['.profile1','.profile3']; selection = selection.join(','); $(selection).add

[jQuery] Re: what is the best way to do this

2008-10-15 Thread pedalpete
I don't think you can 'get' class attributes (though you could try $ ('div').attr('class');). I you can get the ids. I set the id and then use jquery search class so if you had [code] [/code] etc. you could get the divs by using [code] $('div.profile').attr('id'); [/code]