www.webdeveloper.com
Results 1 to 5 of 5

Thread: [RESOLVED] onclick hide div

  1. #1
    Join Date
    Oct 2007
    Location
    texas
    Posts
    121

    resolved [RESOLVED] onclick hide div

    Code:
    <div id="locLookupDiv" style="position: absolute; z-index: 20; visibility: hidden; width: 360px; background-color: #FFFFFF; border: 1px solid #000000;"></div>
    Is there not an easy way to do an onclick for a div? I just want to be able to hide the div when it is clicked.

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    with javascript:
    Code:
    <div onclick="this.style.visibility='hidden'"></div>

  3. #3
    Join Date
    Oct 2007
    Location
    texas
    Posts
    121
    EZ nuff. Thanks haha.

  4. #4
    Join Date
    Jul 2008
    Posts
    38

    this 1 is old but i wanna change it

    I want to do this exact same thing but not in the same div. id be clicking a img or inside of a <td> on the click of that i want the content in <div> further below to be hidden or changed to blank

  5. #5
    Join Date
    Jul 2008
    Posts
    38

    not so hidden content

    okay, i have successfully hidden the content !! lol. i just said that id.style.hidden on the click of the td.

    but that isnt what i wanted nessisarily. i want my box to colapse. so its not just hidden, its not there. and i have want to be able to un-hide my content.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles