/

HTML / CSS / JavaScript Tutorial

HTML Standard attribute: hidden

[this page | pdf | back links]

The HTML hidden attribute indicates whether an element is hidden.

 

Valid attribute values include:

 

Value

Description

hidden

Element is hidden

 

EXAMPLE:


HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head></head>
<body>
Created using HTML: (element is hidden)<br>
<em hidden>italic text</em>

<br><br>Created using JavaScript: (element is hidden)<br>
<span id="element"></span>

<script>
var x = document.createElement("EM");
x.textContent = "italic text";
x.setAttribute("hidden","hidden");
document.getElementById("element").appendChild(x);
</script>

</body>
</html>


NAVIGATION LINKS
Contents | Prev | Next | HTML Attributes


Desktop view | Switch to Mobile