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>