code>>
<!--Show/Hide Div on Button Click .-->
<html>
<head>
<style>
div{
padding:40px;
background:yellow;
}
</style>
<script type="text/javascript">
function showAndHideDiv(ele) {
var element = document.getElementById(ele);
if (element != null) {
if (element.style.display == "block") {
element.style.display = 'none';
}
else {
element.style.display = 'block';
}
return false;
}
}
</script>
</head>
<body>
<input type="button" value="+/-" onClick="showAndHideDiv('divUniqueId')"/>
<br><br>
<div id="divUniqueId" style="display:none">
<button>Button 1</button>
<button>Button 2</button>
</div>
</body>
</html>
No comments:
Post a Comment