I dont think I am using the .remove correctly because instead of “info about canada” being removed from the div “info”, it is stacked on top of “info about russia” instead.
js
if (code == 'ca') {
$('#info').append('<p class="i">info about canada</p>');
} else if (code == 'ru') {
$('#info').remove('.i');
$('#info').append('<p class="i">info about russia</p>');
}
html
<div id="info">
<h3>Info</h3>
</div>
I figured it out…I used .empty instead.