【发布时间】:2018-04-12 15:27:10
【问题描述】:
为什么这段代码不起作用;
HTML:
<div>
<button id="jsstyle" onclick="js_style()">Click to change table size</button>
</div>
JavaScript:
function js_style () {
document.getElementById ("table").text.style.fontSize = "14pt";
}
【问题讨论】:
-
删除
text。这样做:document.getElementById("table").style.fontSize = "14pt"; -
什么是
table?
标签: javascript html font-size