我想要一个html代码,弹出一个提示框,用户必须输入详细信息,然后详细信息将一直显示在我的网页中 - 即使用户刷新页面,细节依旧显示在我的网页上。
现在我有html代码,弹出一个提示框,用户必须输入详细信息,然后详细信息将显示在我的网页中。但是,一旦用户刷新网页或转到其他网站,详细信息将被清除。
所以有人可以真的帮助我吗?继html代码。
<!DOCTYPE html>
<html>
<body>
<p>The human whose name is written in this note will die.</p>
<p>This note will not take effect unless the writer has the person's face in their mind when writing his/ her name.</p>
<p>Therefore, people sharing the same name will not be affected.</p>
<p>If the cause of death is written within 40 seconds of writing the person's name, it will happen.</p>
<p></p>
<button onclick="myFunction()">Write Name.</button>
<p id="demo"></p>
<script>
function myFunction() {
var person = prompt("Please enter the name");
var cause = prompt("Cause of death");
if (person != null) {
document.getElementById("demo").innerHTML =
person + " will die of " + cause + " in 40 seconds...";
}
}
</script>