Here\'s what I\'m trying to do:
Currently I am using this to create an array of all elements matching the class name of .cookie. Right now I am getting
.cookie
I think this should do what you're after:
var ids = $('.cookie').map(function(index) { // this callback function will be called once for each matching element return this.id; });
Documentation for map.
Here's a working jsFiddle demo.