re[jQuery] -ordering elements
Hi,
I have a set of td which have id's like:
<td id="order1">[...]
<td id="order3">[...]
<td id="order2">[...]
<td id="order4">[...]
I would like to re-order them to have consecutive numbers,
what is the best way to achieve this ?
So far I have the code below, which iterates through all td's:
$('td[id^=order]').each(function(i) {
tdId = $(this).attr('id').substring(5, $(this).attr('id').length);
alert(tdId + ' - ' + (i+1));
// ......
});
Thank you for any help!
--
View this message in context: http://www.nabble.com/re-ordering-elements-tp24045411s27240p24045411.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.