Programming/Javascript / / 2020. 11. 16. 16:30

div 랜덤으로...

728x90
<div id="test">
	<div class="slide">1</div>
	<div class="slide">2</div>
	<div class="slide">3</div>
</div>
$(function() {
	$("#test").html($("#test .slide").sort(function() {
		return Math.random() - 0.5;
	}));
});

 

반응형