设置格式为什么只有一个变了
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>js相关属性</title>
</head>
<body>
<p id="con">JavaScript</p>
<script type="text/javascript">
var mychar= document.getElementById("con");
document.write("结果:"+mychar+"<br />"); //输出获取的P标签。
document.write("原结果:"+mychar.innerHTML+"<br />");
mychar.innerHTML="HTMLCSS"
document.write("改变后结果:"+mychar.innerHTML+"<br />");
mychar.style.color="red";
mychar.style.backgroundColor="#123";
mychar.style.width="100px";
document.write("改变后结果:"+mychar.innerHTML+"<br />");
</script>
</body>
</html>