Glen Lipka wrote:
*boggle*. Ill have to study that. Looks complicated.
Glen
Glen, it's not complicated at all :-)
I'm using jQuery's $.map method to translate one array - the result set
$('#container [EMAIL PROTECTED]') - into another array, containing all the ids of
the items in there. What gets into the resulting array is controlled by
what is returned by the translater function given as second argument to
$.map:
function() {
return this.id;
}
Knowing that $.map returns another array, I can then use the Array.join
method to concatenate the array items into a string:
$.map( ... ).join(',');
I haven't actually tested the whole thing. It may be necessary to
convert the result set into a real array:
$('#container [EMAIL PROTECTED]').get()
I chose another selector by the way to match only descendants that do
actually have an id.
--Klaus