How to change FontSize By JavaScript?

后端 未结 5 1738
独厮守ぢ
独厮守ぢ 2020-11-27 21:45

This code is not working

var span = document.getElementById(\"span\");
span.style.fontsize = \"25px\";
span.innerHTML = \"String\";

<

5条回答
  •  借酒劲吻你
    2020-11-27 21:55

    JavaScript is case sensitive.

    So, if you want to change the font size, you have to go:

    span.style.fontSize = "25px";
    

提交回复
热议问题