Using jQuery, what's the performance difference between using:
$('#somDiv').empty().append('text To Insert')
and
$('#somDiv').html('text To Insert')
?
$('#somDiv').html(value) is equivalent to $('#somDiv').empty().append(value).
$('#somDiv').html(value)
$('#somDiv').empty().append(value)
Source: jQuery source.
2.1m questions
2.1m answers
60 comments
57.0k users