為什么提交后樣式?jīng)]改變呀
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>style樣式</title>
</head>
<body>
? <h2 id="con">I love JavaScript</h2>
? <p> JavaScript使網(wǎng)頁顯示動態(tài)效果并實現(xiàn)與用戶交互功能。</p>
? <script type="text/javascript">
? ? var mychar= document.getElementById("con");
? ? mychar.style.color="red";
? ? mychar.style.backgroundColor="#CCC";
? ? mychar.style.width=300px;
? </script>
</body>
</html>
2015-12-08
300px沒加引號,導致所有js都沒執(zhí)行