Automatic Reordering of <li> elements

Automatic Reordering of <li> elements

Hi there,

I have a set of <li> elements I would like to effectively shuffle (taking the bottom one and putting it on top). What would be the best way to do this?

The list - 

  1. <ul>
  2.       <li><a href="#">link 1</a></li>
  3.       <li><a href="#">link 2</a></li>
  4.       <li><a href="#">link 3</a></li>
  5.       <li><a href="#">link 4</a></li>
  6. <ul>
If I haven't made sense here is a static mockup.

Thanks
Ralph