SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Hide divs

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hide divs

    How can i hide all <div>'s within a web page ?

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function hideAllDivs()
    {
        var divs = document.getElementsByTagName("div");
    
        for (var i = 0; i < divs.length; ++i) {
            divs[i].style.display = "none";
        }
    }
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks


Bookmarks

Posting Permissions

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