Total members 11895 |It is currently Sun Dec 22, 2024 6:24 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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 .



_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  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     -  
 How can i hide all topics from Guests ?     -  
 hide cell in table     -  
 hide paragraph using jquery     -  
 Hide elements by class selector     -  
 Hide the background image by one click     -  
 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
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com