appending and removing content with jquery

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.


if (code == 'ca') {
        $('#info').append('<p class="i">info about canada</p>');
    } else if (code == 'ru') {
        $('#info').append('<p class="i">info about russia</p>');


<div id="info">


If you are trying to replace the contents of #info then don't use remove, empty, or append, just use html:

$('#info').html('<p class="i">info about russia</p>');

Need Your Help

getting value from other column besides the valuemember column in Infragistics ultracombo visual-studio combobox infragistics ultracombo

I am fairly new to using infragistics controls (started yesterday). While they are (very) impressive they do add another layer of complexity, which I am muddeling through. So I am asking what I fee...