/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* <div id="latest_left"> <ul> <li>1<li> <li>1<li> <li>1<li> <li>1<li> </ul> </div> <div id="latest_right"> <!--important it shud be here.--> </div> */ $("#latest li:nth-child(4)").prependTo("#latest_right"); $("#latest li:nth-child(5)").prependTo("#latest_right"); $("#latest li:nth-child(6)").prependTo("#latest_right"); $("#latest li:nth-child(7)").prependTo("#latest_right"); $("#latest li:nth-child(2)").prependTo("#latest_right"); OR /* <div id="latest_left"> <ul> <li>1<li> <li>1<li> <li>1<li> <li>1<li> </ul> </div> <div id="latest_right"> <!--important it shud be here.--> </div> */ $("#latest_left ul").prependTo("#latest_right");