Home > ASP.Net, Javascript > Show and Hide DIV

Show and Hide DIV

Try this example:


<script language="javascript">
 function showDiv()
       var div = document.getElementById('myDiv');
       div.style.position = "absolute";
       div.style.visibility = "visible";
       div.style.display = "block";
       div.top = "50";
       div.left = "50";

function closeDiv()
     var div = document.getElementById('myDiv');
     div.style.visibility = "hidden";
     div.style.display = "none";

<div id="myDiv" style="display:none;Visibility:hidden; width:100px; height:150px"  >
any text here
<input type="button" value="Close" onclick="closeDiv()" />
<span style="color:blue; cursor:pointer"  onclick="showDiv()"  ><u>Click</u></span>

Good Luck

Categories: ASP.Net, Javascript
  1. No comments yet.
  1. No trackbacks yet.

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 )

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

%d bloggers like this: