jQuery .append() inserts content to the end of the target; difference between .append() and .appendTo();
<script>
$(function() {
$('div').append($('<strong> - append text</strong>'));
$('p').append($('<strong>').attr('title', 'text title attr').text(' - append text with title attr'));
});
</script> |
<script>
$(function() {
$('div').append($('<strong> - append text</strong>'));
$('p').append($('<strong>').attr('title', 'text title attr').text(' - append text with title attr'));
});
</script>
<div>div</div>
<p>paragraph</p> |
<div>div</div>
<p>paragraph</p>