I am facing an issue with the following code snippet:
<li id="machine" ><h1>Machine</h1></li>
<li id="player"><h1>Player</h1></li>
It displays as shown in the image below:
https://i.sstatic.net/CR3Ut.png
However, when I use jQuery to update the text to a number like this:
$("#machine").text(1);
$("#player").text(2);
it changes my h1
tags to normal text displayed like this:
https://i.sstatic.net/LqkoW.png
How can I ensure that the h1
tag remains unchanged even after passing a number?