Show and Hide DIV using javascript


<script language=”JavaScript” type=”text/javascript”>
function Test(rad){
var rads=document.getElementsByName(;

<input name=”selection” type=”radio”  onclick=”Test(this);”/>
<input name=”selection” type=”radio”  onclick=”Test(this);”/>

<div id=”courier”>Select your courier:<br />
Blah blah….Dropdown to come here</div>



when you load the page nothing will be selected.

but when you select first radio button it will hide the div and when  second radio button selected it will show the div.

you can use this for table hide .

its so simple with javascript.

Try this ……..!!!!!!!!!!!






Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s