How can I print results to a span using a document.getElementById? [closed]

I am trying to show output to a span element by attaching a getElementById to the span but the output shows up for less than a second then disappears.

document.getElementById("stats").innerHTML =
        "Wisdom: " + wisdom + "<br>" +
        "Charisma: " + charisma + "<br>" +
        "Intellect: " + intellect + "<br>" +
        "Strength: " + strength + "<br>" +
        "Dexterity: " + dexterity + "<br>" +
        "Constitution: " + constitution;
<p>Total Stats with Modifiers: <span id="stats"></span></p>

I have tried moving the span, sending the output to a read only button (which works but cuts off a lot of the output) and using a script in the html. None gets the desired results, as I have the span put in the aside element and I want the users to see the results from their choice there after they hit the submit button. The top code block is located in a function that as ran when the user clicks on the submit button.