Basically, I am trying to gather the IDs of every element with a specific class and place those IDs into an array. I'm using jQuery 1.4.1 and have tried using .each(), but don't really understand it or how to pass the array out of the function.
$('a#submitarray').click(function(){
var datearray = new Array();
$('.selected').each(function(){
datearray.push($(this).attr('id'));
});
// AJAX code to send datearray to process.php file
});
I'm sure I'm way off, as I'm pretty new at this, so any advice help would be awesome. Thanks!