為什么亂碼了
<!DOCTYPE HTML>
<html>
? ? <head>
? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=gb18030">
? ? ? ? <title>插入js代碼</title>
? ?<script type="text/javascript">? ? ?
? ? ? ? document.write("開啟JS之旅!");
? ? </script>
? ? </head>
? ? <body>
? ? </body>
</html>
2020-02-23
可以換一個編碼試一試
2019-08-20
<!DOCTYPE HTML>
<html>
??? <head>
??????? <meta http-equiv="Content-Type" content="text/html; charset=gb18030">
??????? <title>插入js代碼</title>
??????? <script type="text/javascript">
??????? document.write("開啟JS之旅!");
??????? document.getElementById("p1").style.color="blue";
??? </script>
?<style type="text/css">
?
?p{
???? color:blue;}
???? div{background-color: lightgrey;
??? width: 300px;
??? border: 25px solid green;
??? padding: 25px;
??? margin: 25px;
}
?</style>
??? </head>
?????? <body>
????????? <h1><p id="p1">css盒子模型代入JS</p></h1>
??? <div>我堅定的想信世上任何事物都會有捷徑</div>
??? </body>
</html>
2019-08-06
應該不是代碼的問題,我復制你的代碼運行,顯示結(jié)果沒問題,你換個瀏覽器看看?