How could I output values of some variables in HTML or JavaScript?
I have this html file on my cellphone:
text = "";
function Show(x)
{
text = text + " " + x;
document.getElementById("Line").innerHTML = text;
}
.GoToPanelButtons {
color: maroon;
background:pink;
font-size:72px;
}
<div>Click randomly on any of these buttons:</div>
<button class="GoToPanelButtons" onclick="Show('cat')">cat</button>
<button class="GoToPanelButtons" onclick="Show('dog')">dog</button>
<button class="GoToPanelButtons" onclick="Show('rat')">rat</button>
<br>
<br>
<div>Here is what you've clicked on:</div>
<br>
<div id="Line">---</div>
and I want to be able to return to what I have typed here - that is the contents of variable x in the code - after I turn my cellphone off. However, if I turn it off and then turn it on again the variable is blank and whatever I have typed is gone.
I've looked through similar questions here on StackOverflow, but it seems that "outputting" there means simply displaying.
Is outputting that I am talking about possible in HTML or JavaScript at all?