【发布时间】:2013-06-04 14:50:10
【问题描述】:
<html>
<head>
</head>
<body>
<div id = "start">
<h3>Start</h3>
<script>
if(Go==false)
document.write("<p>None </p>");
else
document.write("<p>Month: Day: Hour: Min: </p>");
</script>
</div>
<script>
var change = function(){
document.getElementById('start').innerHTML +=document.write("<p>NO</p>");
};
</script>
<input type = "button" value =start onClick = "change(); return false;"/>
<body>
</html>
它刷新页面,我需要将它添加到 div“开始”。有任何想法吗?我一直在网上查找带有修复程序的东西,但似乎没有一个对我有用。我用的是chrome,不知道有没有用。
【问题讨论】:
-
我真的希望教程从来没有教过
document.write!你看到它造成的麻烦。 :) -
如果这是您的真实 HTML,则按钮上的 value 属性不会包含在
"中。 -
他们应该把 document.write 拿出来......它没有我见过的实际用途。
标签: javascript html webpage