javascript | div | hide show | button with source code
<script>
function funshow()
{
if(document.getElementById("but1").value=="show")
{
document.getElementById('div1').style.visibility="visible"
document.getElementById("but1").value="hide"
}
else
{
document.getElementById('div1').style.visibility="hidden"
document.getElementById("but1").value="show"
}
}
</script>
<body>
<input type="button" value="show" id="but1" onclick="funshow()">
<div id='div1'style="visibility:hidden">
<table bgcolor="lightblue">
<tr><td>
Usename</td>
<td><input type="text"></td></tr>
<tr><td>
Password</td>
<td><input type="text"></td></tr>
<tr><td><input type="button" value="click">
</td></tr>
</table>
</div>
</body>
<script>
function funshow()
{
if(document.getElementById("but1").value=="show")
{
document.getElementById('div1').style.visibility="visible"
document.getElementById("but1").value="hide"
}
else
{
document.getElementById('div1').style.visibility="hidden"
document.getElementById("but1").value="show"
}
}
</script>
<body>
<input type="button" value="show" id="but1" onclick="funshow()">
<div id='div1'style="visibility:hidden">
<table bgcolor="lightblue">
<tr><td>
Usename</td>
<td><input type="text"></td></tr>
<tr><td>
Password</td>
<td><input type="text"></td></tr>
<tr><td><input type="button" value="click">
</td></tr>
</table>
</div>
</body>
0 comments: