PhilipK Posted July 2, 2011 Share Posted July 2, 2011 Hello, I need to use Jquery or plain Javascript to reverse the order of a list of <span> tags. They all have the class "tweet_text" Any suggestions are greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/240954-reverse-order-of/ Share on other sites More sharing options...
WebStyles Posted July 3, 2011 Share Posted July 3, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.