Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse numbers in ordered list?

Status
Not open for further replies.

Deeba

Programmer
May 8, 2002
32
CA
Hi,

I would like to know if it's possible to reverse the order of the numbers in an ordered list, say it starts at 30 and goes down to 1.

I would like to do this without coding the value for every <LI> tag, as they could change in the future.

Wondering if this could be done with CSS or even Javascript?

Thanks,

~Lori
 
In JS, if you have the numbers in an array, you can either read the array from the end, or use arrayname.reverse()

Lee
 
Thanks for your response.

Is there any way to do this without Javascript - ie with CSS and HTML?

~Lori
 
There is a CSS2 property that allows that but aside from Opera no browser supports it yet. Until we have some better support for CSS2 you will have to stick to JS.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top