Hide/Show using JavaScript

Saturday, April 19th, 2014 javascript, PHP

To hide the Div : style=”display:none”;

To visible the Div : style=”display:block”;

<html><head><script type="text/javascript">
function showdiv()
document.getElementById(‘adu’).style.display = "block";
document.getElementById(‘adu’).style.display = "none";
document.getElementById(‘adu’).style.display = "none";
<table border="0">
<td>Member Type</td>
<input id="adult" onclick="showdiv();" type="radio" name="member" value="Adult" />
<input id="child" onclick="showdiv();" type="radio" name="member" value="Child" /></td>

<div id="adu" style="display:none">
<tr><td>Name</td><td><input type="text" value=""></td></tr>



When you Click the Adult , you will not see the text box below.

When you click the child, the below text box will be visible.

Member Type  Adult
Name    *


No comments yet.

Leave a comment

Request a Free SEO Quote