Is it possible to replace a div element with jquery and update the dom?
- by Scarface
Hey guys quick question, I want to update the contents of a div with two new divs to take the place of the previous ones. Each new div has a unique id to take the place of the old ones. I then want any further update to use the ids of the new divs as their values instead of the original. Is this possible in Jquery? Thanks in advance for any assistance.
var display_total=$(".display_total").attr("id");
var display_of_total=$(".display_of_total").attr("id");
var new_display_of_total=parseInt(display_of_total)+1;
var new_display_total=parseInt(display_total)+1;
$('.totalmessages').html('<div class="display_of_total" id="'+new_display_of_total+'">Displaying '+new_display_of_total+' of </div><div class="display_total" id="'+new_display_total+'">'+new_display_total+' messages...</div>');