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>