ボタンがクリックされた後、ページがリロードされた後、クリックされた状態を保持する方法を見つけようとしています。私のコードブローでは、onclickイベントを使用しているので、別のイベントを追加する必要がある場合は、そうすることができます...クリックされた状態を維持する方法を見つけようとしています。いつでも助けてくれてありがとう、ありがとう。
<html>
<head>
<style type="text/css">
#sub3 {
position: absolute;
left: 100px;
top: 200px;
background-color: #f1f1f1;
width: 180px;
padding: 10px;
color: black;
border: #0000cc 2px dashed;
display: none;
}
</style>
<script language="JavaScript">
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
</script>
</head>
<body >
<input id="input1" type=button value='Show Layer' onclick="setVisibility('sub3', 'inline');";>
<div id="sub3">Message Box</div>
</body>
</html>