【发布时间】:2021-08-19 18:04:18
【问题描述】:
例如这是我的代码
<html>
<head><title>Document</title></head>
<body>
<script>
let input0 = parseInt(prompt("Write a number"))
let input1 = parseInt(prompt("Write an other number"))
if (input0 === input1){
//Here I want to print some text on webpage intead of
//using document.write or console.log
}
</script>
</body>
</html>
现在我想在 h1 标签中打印一个文本,但是如果条件满足,我该如何执行这个任务
【问题讨论】:
-
使用innerHTML为你的
h1标签设置数据 -
到目前为止你尝试过什么?你被困在哪里了?
-
在使用 Stackoverflow 之前请read introductory tutorials。
标签: javascript html