0
当我点击按钮时,我希望文本显示在网页的顶部,在红色的横幅中。我已经看过谷歌和YouTube,无法在任何地方找到解决方案。如果任何人都可以看看我的代码,看看我可以如何使这项工作,请!非模态功能,警报出现在红色横幅页面的顶部
<html>
<head>
<title> Non-Modal Alert Messages</title>
<link rel="stylesheet" type="text/css" href="nonmodal1.css">
<script type = "text/javascript">
function reveal(){
document.getElementById('theDiv').innerHTML='You have touched the button!'}
function hide(){
document.getElementById('theDiv').innerHTML='' }
</script>
</head>
<body>
<form>
<input type = "button" onclick = "reveal()" value = "Button">
<input type = "button" onclick = "hide()" value = "Close Alert">
</form>
<div id = "theDiv">
</div>
</body>
<html>