请高手解答!谢谢!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>math实例-字体颜色更改</title>
<script type="text/javascript">
function change(){
var red=Math.ceil(Math.random()*255);
var green=Math.ceil(Math.random()*255);
var blue=Math.ceil(Math.random()*255);
var color="#"+red.toString(16)+green.toString(16)+blue.toString(16);
document.getElementById("me").style.color=color;
//document.getElementsByTagName(P)[0].style.color=color;
}
</script>
</head>
<body>
<p id="me">我要改变颜色!</p>
<input type="button" value="更改字体颜色" onclick="change()"/>
</body>
</html>
画下划线的两句,为什么第一句可以正常运行,第二句就不能正常运行,错在哪呢?