JavaScript moving element in the DOM

后端 未结 7 1683
囚心锁ツ
囚心锁ツ 2020-11-27 12:25

Let\'s say I have three

elements on a page. How can I swap positions of the first and third
? jQuery is fine.

7条回答
  •  被撕碎了的回忆
    2020-11-27 12:57

    Jquery approach mentioned on the top will work. You can also use JQuery and CSS .Say for e.g on Div one you have applied class1 and div2 you have applied class class2 (say for e.g each class of css provides specific position on the browser), now you can interchange the classes use jquery or javascript (that will change the position)

提交回复
热议问题