初学者提问,为什么老是提示 缺少对象啊!
<html>
<head>
<title>
动态修改页面上的文字的字体
</title>
<script language="javascript">
var newasp_fontsize = 9;
var newasp_lineheight = 18;
//增加字体
addfontsize1 = function()
{
document.getElementById("NewaspContentLabel").style.fontSize = ++newasp_fontsize + "pt"
document.getElementById("NewaspContentLabel").style.lineHeight = ++newasp_lineheight +"pt"
}
//缩小字体
decfontsize2 = function() {
document.getElementById("NewaspContentLabel").style.fontSize = --newasp_fontsize + "pt"
document.getElementById("NewaspContentLabel").style.lineHeight = --newasp_lineheight + "pt"
}
</script>
</head>
<body>
<table width="100%" height="100%" border=1 bordercolor=gray>
<tr>
<td height=24 colspan=2 width="100%" align=right>
<a style="CURSOR: hand; POSITION: relative" title="减小字体" id="addfont"><img onclick="addfontsize1()" src="img/dec.gif" border="0" width="15" height="15"><font color="#FF6600">减小字体</font></a>
<a style="CURSOR: hand; POSITION: relative" title="增大字体" id="decfont"><img src="img/add.gif" border="0" width="15" height="15"><font color="#FF6600">增大字体</font></a>
</td>
</tr>
<tr>
<td width="20%" >
导航栏
</td>
<td idth="80%">
<div id="NewaspContentLabel" style="display:block;padding:0px 10px;LINE-HEIGHT: 18pt;"><FONT id=font_word style="FONT-SIZE: 14px; FONT-FAMILY: 宋体, Verdana, Arial, Helvetica, sans-serif"><P><font face=Verdana>浙江经贸学院周文根一行来中心参观</font></P>
<P>2009年2月27日,浙江经贸学院副院长周文根、教务处处长章剑林、设备处处长梁小碗等一行15人在学校副院长冯浩,设备处处长尤小军,副处长李成和中心副主任张玉才的陪同下进行了参观和交流。</P>
</font></div>
</td>
</tr>
</table>
</body>
</html>