i have one simple page of html with this code:
<p id="demo" onload="prtdate()"></p>
<p id="p1">JAVA SCRIPT</p>
<button onclick="bigsize()" type="button">Click me to BigSize</button>
<script>
function prtdate() {
document.getElementById("demo").innerText = new Date();
}
function bigsize() {
document.getElementById("demo").style.fontSize = 30px;
}
</script>
30px is not in "" i know it must surround with ""
but my question is when left 30px whiteout "" why prtdate() not run?
even if change :
document.getElementById("demo").style.fontSize = 30px;
to:
document.getElementById("test").style.fontSize = 30px;
it is also no show date in prtdate().