|

楼主 |
发表于 2019-7-2 14:00:47
|
显示全部楼层
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>鱼C-prompmt</title>
<style type="text/css">
body{
margin: 333px;
}
</style>
</head>
<body>
<h1>敢不敢点下面的对话框?</h1>
<button onclick="myFunction()">来嘛~</button>
<p id="fishc"></p>
<script>
function myFunction(){
var x;
var person = prompt("鱼C-7周年盛典有什么好建议?","例如:金主撒钱");
if (person!=null && person!=""){
x="已经收到你的祝福 " " + person + "" 萨瓦迪卡~";
document.getElementById("fishc").innerHTML=x;
}
}
</script>
</body>
</html> |
|