Show and Hide DIV using javascript

<html>
<head>

<script language=”JavaScript” type=”text/javascript”>
function Test(rad){
var rads=document.getElementsByName(rad.name);
document.getElementById(‘courier’).style.display=(rads[1].checked)?’none’:’none’;
document.getElementById(‘courier’).style.display=(rads[1].checked)?’block’:’none’;
}
</script></head>

<body>
<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>

</body>

</html>

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 ……..!!!!!!!!!!!

 

 

 

 

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s