浏览器显示“thinksHarry Potter”,“thinks”和“harry”两个词之间没有空格,所以我的伙计们能告诉我该怎么做吗?这是我的代码:
<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var person = prompt("Please enter your name", "Harry Potter");
if (person != null) {
alert("thinks" + person);
}
}
</script>
</body>
</html>