Just generate a random number with Javascript, and throw in a few characters for good measure. Like maybe the tagName followed by a four or five (you could go higher if you'er paranoid) digit random number. And/or you could use a time stamp of some sort.
If you want to go the extra mile, you could try to select with the new ID just to make sure it doesn't already exist. But I think a simple random ID of several digits would be fine, and you can write the algorythm right in the .attr('id', ...) method. Larry Guy Fraser wrote: > > On Dec 23, 5:09 am, dn2965 <[EMAIL PROTECTED]> wrote: > > > >> hello everyone > >> i want to know a way to general unique id for new append element. like > >> EXT's .id(); > >> > > I don't think there is any equivalent in jQuery at present. It would be > useful though as I've had several occasions myself when such a feature > would be useful. > > For anyone not familiar with the feature in Ext, it basically gives you > a guaranteed unique ID (ie. checks there are no other ids or names with > same value in the document). > > Guy