感覺(jué)自己寫的沒(méi)錯(cuò)啊,為什么結(jié)果里沒(méi)有php:
感覺(jué)自己寫的沒(méi)錯(cuò)啊,為什么結(jié)果里沒(méi)有php:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>無(wú)標(biāo)題文檔</title>
</head>
<body>
<ul id="test"><li>JavaScript</li><li>HTML</li></ul>?
?
<script type="text/javascript">
? var otest = document.getElementById("test"); ?
? var newnode=document.createElement("li");
? newnode.innerHTML("php");
? otest.insertBefore(newnode,otest.lastChild);
</script>?
</body>
</html>
2017-02-01
newnode.innerHTML="php";這樣寫才是對(duì)的