Jump to content

Reverse order of <span>


PhilipK

Recommended Posts

how about:

 

document.getElementsByTagName('span');

 

to read them all into an array, then you can get each one's content with

 

spanList[0].innerHTML;

 

then just reverse them (or whatever) and write them back with the same code:

 

spanList[0].innerHTML = 'whatever';

Link to comment
https://forums.phpfreaks.com/topic/240954-reverse-order-of/#findComment-1237778
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.