Skip to content

Instantly share code, notes, and snippets.

@pon-x

pon-x/visible.html

Created Nov 9, 2020
Embed
What would you like to do?
表示・非表示の制御
<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