I need to clear the <div> and insert new content I get from the database after each while loop in php. Can someone help me out with this problem?
Also I need to sleep in the loop for about 10 sec.
I am using PHP for the while loop.
The general flow is like this -
while() {
read from database;
sleep;
clear div; ///I nead help here;
Add content to div ///I need help here
}
Thanks
to clear -
$("div").empty();to fill -
$("div").html(your_ajax_response);