I have the following paragraph to which content of array added
$('#pop').html(arr.join('<br>'))
I want to do like clear and add.
$('#pop').text('').html(arr.join('<br>'))
I have the following paragraph to which content of array added
$('#pop').html(arr.join('<br>'))
I want to do like clear and add.
$('#pop').text('').html(arr.join('<br>'))
uh.. keep using .html?
$('<p>').html( [1,2].join('<br>') ).html('').html( [2,3].join('<br>') )
Though I don't see the point of doing .html('') if you're going to replace it with new text anyway ...
text
in like html
only with HTML tags. So there is no need to call text("")
before replacing the whole HTML content of that element with html
.