您如何制作这样的功能,当您在输入或提交时将任何内容输入到文本框中时,您输入的内容显示在文本框下。文本框然后会清除,以便您可以编写更多内容,例如Facebook上的评论功能?来自文本框的Javascript变量
我不希望它是一个弹出窗口。
谢谢。
<!DOCTYPE html>
<html>
<body>
<input onclick="myFunction()" type="text">
<script>
function myFunction()
{
var x;
var person=prompt("Please enter your name");
if (person!=null)
</script>
<p id="demo">
<script>
function myFunction()
{
x="Hello " + person;
document.getElementById("demo").innerHTML=x;
}
}
</script>
</body>
</html>