Any way to shuffle content in multiple div elements

前端 未结 8 1077
鱼传尺愫
鱼传尺愫 2020-12-31 23:32

I\'m relatively new to Javascript and was wondering if there\'s a quick way to shuffle content that is contained in multiple

tags. For example

8条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-01 00:04

    I'd wrap the divs in an outer div, then pass its id to shuffle_content().

    In there, you could create a new div, cloning the wrapper div's nodes in a random order to fill it, then replace the wrapper div with the new div.

提交回复
热议问题