Or, using v1.2... var ids = $('*').map(function(i,v){return (this.id?this.id:null);}).get().join(',');
spinnach wrote: > > > no, but it's easy to build a simple plugin that does that: > > jQuery.fn.allIDs = function(){ > var IDs = []; > this.each(function(){ > if (this.id) IDs.push(this.id); > }); > return IDs; > } > > and use like: > var IDs = $(".list li").allIDs() > > the plugin returns an array, if you want a string you can do this (or > change the return IDs in the plugin to return IDs.join(',') ): > var IDstring = IDs.join(','); > > dennis. > > [EMAIL PROTECTED] wrote: >> hi, i think im blind :/ >> is there any jquery function or a short way to get a string with all >> ids of elements? >> for example >> >> $(".list li").allids() >> >> output something like that: >> element1,element2,element3 >> >> > > > -- View this message in context: http://www.nabble.com/ids-of-elements-in-a-string-tf4497260s15494.html#a12834819 Sent from the JQuery mailing list archive at Nabble.com.