Why am I getting this error?
Posted
by Doug
on Stack Overflow
See other posts from Stack Overflow
or by Doug
Published on 2010-05-09T04:55:26Z
Indexed on
2010/05/09
4:58 UTC
Read the original article
Hit count: 221
JavaScript
function changeSize( fontsize ) {
var body = document.getElementById("body");
var font = fontsize + "-font";
body.className = font;
}
<input type="button" onclick="changeSize(small)" value="Small" />
Firefox console keeps saying that small is undefined. What am I doing wrong?
© Stack Overflow or respective owner