How to sort this div by ID with jquery?
<div id="p38" class="p33">Test</div>
<div id="p35" class="p33">Test</div>
<div id="p45" class="p45">Test2</div>
<div id="p33" class="p33">Test</div>
Im now using this js
function callMeOften()
{
$.ajax({
method: 'get',
url : '1.php',
dataType : 'text',
success: function (text) {
$('#updateMe').html(text) ;
}
});
}
var holdTheInterval = setInterval(callMeOften, 5000);
$(".p<? echo $userRank['userID'] ?>").appendTo("#statMSG1").filter(".p<? echo $userRank['userID'] ?>:gt(0)").remove();
});
Actually i get new results from 1.php as can you see above.. and new results always appears at bottom , i need to reverse results and new must be on top
Perhaps use
prependTo()instead ofappendTo():