源自:3-3 innerHTML 属性
为什么结果是这样的?大神
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h2 id ="x">hello </h2>
<script type="text/javascript">
var name = document.getElementById("x");
document.write("原标题:"+name.innerHTML+"<br>");
name.innerHTML = "LOL";
document.write("修改后的内容:"+ name.innerHTML);
</script>
</body>
</html>
提问者:professor景
2019-03-18 20:34
个回答
-
name不能做变量名
-
undefined