Switch to full style
HTML,DHTML,Javascript,XML,CSS
Post a reply

Hide HTML Div using JavaScript

Fri Aug 03, 2007 2:53 pm

Hide HTML Div using JavaScript
This is the code i made .It contain javascript and html.The code allow to hide the <div> part with press on the link.The link contain an event "onclick".A function called makeInvisble().Inside this function i change the property .style.visibility="hidden" .Here is :
Code:
<html>


<
script type="text/javascript">
 
  function 
makeInvisible()
  {
    
document.getElementById("newDIV").style.visibility="hidden";
   
  }



</script>

<body>
<div id="newDIV" style="position:absolute; top:100; left:150; visibility:visible" >
The shadow of my dreams ......... 
</div>
<a href="#" onclick="makeInvisible();"  >Click Here</a>
</body>
</html>


Also , as you can see i used id="newDIV" for the <div> part .Id must start with letters .In the style position:absolute; means that you start your page form top-left .top=100 means leave 100 pixels from top.and the same to left .



Post a reply
  Related Posts  to : Hide HTML Div using JavaScript
 How to use HTML with JavaScript     -  
 cotact us html and javascript form     -  
 Hide the content of the div     -  
 hide paragraph using jquery     -  
 How can i hide all topics from Guests ?     -  
 hide cell in table     -  
 Hide the background image by one click     -  
 Hide elements by class selector     -  
 I want to hide add to cart button for guest users. Need help     -  
 Hide, show and toggle effects with speed control     -  

Topic Tags

HTML Div