Created
November 9, 2020 00:37
-
-
Save pon-x/798d1406fd3d03d19c2eacad04f20bdb to your computer and use it in GitHub Desktop.
表示・非表示の制御
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<input type="button" value="表示/非表示" onclick="navi()"> | |
<div id="disp"> | |
ここの内容を表示/非表示にする。 | |
</div> | |
<script> | |
window.onload = function () { | |
document.getElementById("disp").style.display="none"; | |
}; | |
function navi(){ | |
if (document.getElementById("disp").style.display=="block"){ | |
document.getElementById("disp").style.display="none"; | |
}else{ | |
document.getElementById("disp").style.display="block"; | |
} | |
} | |
</script> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment