I use jQuery .html()
but is it possible to add an element without to removing the other HTML elements?
My code look so:
<div id="contentboxes">
<div class="con1">content 1</div>
<div class="con1">content 2</div>
</div>
I have tried this with jquery:
$('#contentboxes').html('<div class="con3">Content 3</div>');
But this mand removes my other 2 boxes, is it possible to add without to removing other boxes?
I use jQuery .html()
but is it possible to add an element without to removing the other HTML elements?
My code look so:
<div id="contentboxes">
<div class="con1">content 1</div>
<div class="con1">content 2</div>
</div>
I have tried this with jquery:
$('#contentboxes').html('<div class="con3">Content 3</div>');
But this mand removes my other 2 boxes, is it possible to add without to removing other boxes?
use .append()
instead of .html()
.
$('#contentboxes').append('<div class="con3">Content 3</div>');
http://api.jquery./append/