DEV Community

Cover image for HTML hidden element
Digital Academy
Digital Academy

Posted on • Originally published at gitdemy.com

2 1

HTML hidden element

What is The HTML hidden attribute?

The HTML hidden attribute is used to hide an element. It indicates that the element is not yet, or no longer, relevant. It sets the visibility of the elements in the document. When it is present the browser will not display the element to the user, but it remains in its position on the webpage.

The hidden element is used to not show the element to the user unless certain conditions are met such as pressing a button or checkbox, etc. Using JavaScript statement, the hidden attribute can be removed and make the element visible to the user.

Note: The hidden attribute is a boolean attribute.
Example 1
<!DOCTYPE html>
<html>
<head>
<title>hidden attribute</title>
</head>
<body>
<h1>GitDemy</h1>
<h2>HTML hidden attribute</h2>
<!-- hidden paragraph -->
<div hidden>
This content will be hidden while
displaying the content
</div>
<h4>A computer science portal for development.</h4>
</body>
</html>

Output
In the following example, the div element is hidden from the user's view.

Image HTML hidden attribute example output

This article is originally posted on GitDemy
Read full article, click the below link.
HTML hidden attribute

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay