I am trying to use document.getElementById to change the font size of some text, but for some reason it does not change and it remains at 200%. What am I doing wrong.
#detail {
font-size: 200%;
}
<div id = "detail"> Hello World <div>
<script type = "text/javascript">
if (true) {
document.getElementById(detail).style["font-size"] = "100%";
}
</script>
source
share