Reorder html elements in dom

后端 未结 5 494
眼角桃花
眼角桃花 2020-12-10 15:17

I have a list of elements:

5条回答
  •  自闭症患者
    2020-12-10 16:03

    I know this is an old question, but google lead me to it. There is a sub property on flexbox (css) called 'order', that allow you to choose the order that elements are displayed. Is possible to use javascript to change this sub property and reorder the displayed elements.

    https://www.w3schools.com/cssref/css3_pr_order.asp

    Edit 1 - code example:

    
    
    
    One
    Tow
    Three

提交回复
热议问题