Thursday, April 25, 2013

JavaScript function to place div above another object


<!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" -->
<script type="text/javascript" language="javascript">

function show_hide_functiondf()
{
if(document.all("MyDivdf").style. visibility =="visible")
{
document.all("MyDivdf").style. visibility ="hidden";
}
else
{
document.all("MyDivdf").style. visibility ="visible";
}
}
</Script>

<html>
<head>
<body>
<input id="Button1" type="button" value="Select Date" onclick="show_hide_functiondf()" />
</br>
<Div id="MyDivdf" style="visibility : hidden; position: absolute; border : red 3px solid; background: green">
Above
</Div>
Bottom
</body>
</head>
</html>

No comments:

Post a Comment