tags are shown as a plain text after reloading webpage

I have web page that that begin with an empty div. When user a from the requested text is shown inside . The website is using Flask python.

html:

    <div class="window" id="terminal-window"></div>`

javascript:

    $.ajax({
        url: $("#command-form").attr("action"),
        type: "get",
        caches: false,
        data: $("#command-input").serialize(),
        success: function(data){
           
            $("#terminal-window").html(data)    
            
    });

Sample text requested:

   foo
   <br>Command 'foo' is not recognised<br>
   <br>Root>

This script is working fine. But the problem is when the page is reloaded the
tags are shown as plain text. It’s not making a newline.