Javascript Code to Show or Hide Div:
This function can be done easily by java script program .
Technology, SEO, Lifestyle and Crypto updates.
<html>
<head>
<title>Javascript Program to Show/Hide Div Visibility</title>
<script language="javascript" type="text/javascript">
function showHideDiv() {
var divstyle = new String();
divstyle = document.getElementById("div1" ).style.visibility;
if (divstyle.toLowerCase() == "visible" || divstyle == "") {
document.getElementById("div1" ).style.visibility = "hidden";
}
else {
document.getElementById("div1" ).style.visibility = "visible";
}
}
</script>
</head>
<body>
<div id="div1" class="divStyle">
Show/Hide Div tag using java script.
</div>
<center>
<input type="button"
value="show hide div"
onclick="showHideDiv()" />
</center>
</body>
</html>
Comments
Post a Comment