2
Does anyone know how I can sort a set of Ivs through a date present in their content?
for example:
<div class="box" id="box1">
<div class="date">01/05/2018</div>
</div>
<div class="box" id="box2">
<div class="date">04/05/2018</div>
</div>
<div class="box" id="box3">
<div class="date">08/05/2018</div>
</div>
<script>
$(document).ready(function(){
$(".box").each(function(){
var date_content = $(this).find(".date").html();
//aqui seria o momento de adicionar um codigo para ordena-los..
//preciso que apareça da data maior até a menor.. ou seja, o primeiro box com a data mais recente, e os seguintes com as datas mais antigas...
});//end each
});//end doc
</script>
but they are already ordered
– user60252
I need it to appear from the largest date to the smallest.. I mean, the first box with the most recent date, and the following with the oldest dates...
– lazyFox
The sort I refer to is with respect to the date it contains in html, for example, to look as I would like, starting with the latest date and following to the oldest, would be #box3, #box2, #box1
– Neo