On Feb 8, 12:06 am, Alec <sen...@gmail.com> wrote: > Is this the right way to do this? Or is there an easier/better way? I > was hoping for something like this: > > HTML > <div id="entry;12345">something here</div> > <div id="entry;67890">something else</div> > > SCRIPT that does: > search for an element that starts with #entry; and then explode on ';' > to find the entryId.
Posting my problems always gives me new ideas 5 minutes later :) I changed it to this: HTML <div class="entry" id="id-12345">something here</div> SCRIPT to get the ID number: $(this).attr('id').substr(3) (The "id-" part is for XHTML validation; I simply remove it with the substr() function.) I guess this is already much cleaner than the previous code.