hidden Attribute

Description

The hidden attribute is a Boolean attribute that indicates if to show an element.

Example


<!DOCTYPE HTML>
<html>
<head>
<script>
var  toggleHidden = function()  {
    var  elem  = document.getElementById("toggle");
    if (elem.hasAttribute("hidden"))  {
       elem.removeAttribute("hidden");
    }  else  {<!--from   w  w  w  . j a va 2s  . c  o  m-->
       elem.setAttribute("hidden",  "hidden");
    }
}
</script>
</head>
<body>
    <button onclick="toggleHidden()">Toggle</button>
    <table>
        <tr><th>Name</th><th>Value</th></tr>
        <tr><td>HTML</td><td>mark up</td></tr>
        <tr  id="toggle"  hidden><td>CSS</td><td>Style</td></tr>
        <tr><td>Javascript</td><td>Logic</td></tr>
    </table>
</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    HTML »




HTML Introduction
HTML Document
HTML Section
HTML Group Content
HTML Text Marker
HTML Table
HTML Form
HTML Embed