HTML section hidden (2024)

Earn income with your HTML skills

Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.

A hidden attribute on a <section> tag hides the section.

Although the section is not visible, its position on the page is maintained.

A hidden attribute on a <section> element.
The section is not visible.

A hidden section:

<p>A hidden section:</p><section hidden> <h2>The Night Watch</h2> <p>The Night Watch (Dutch: De Nachtwacht), is a 1642 painting by Rembrandt van Rijn. It is in the collection of the Amsterdam Museum but is prominently displayed in the Rijksmuseum (State Museum) as the best-known painting in its collection. The Night Watch is the most famous Dutch Golden Age painting. </p></section>

Using hidden

The hidden attribute hides the <section> element.

You can specify either 'hidden' (without value) or 'hidden="hidden"'. Both are valid.

A hidden <section> element is not visible, but it maintains its position on the page.

Removing the hidden attribute makes it re-appear.

Syntax

<section hidden>

or

<section hidden="hidden">

Values

#

Value Description
hidden Use 'hidden' or hidden='hidden'. Both are valid.

More Examples

Clicking the button toggles A hidden attribute on the <section> element.

The Night Watch

The Night Watch (Dutch: De Nachtwacht), is a 1642 painting by Rembrandt van Rijn. It is in the collection of the Amsterdam Museum but is prominently displayed in the Rijksmuseum (State Museum) as the best-known painting in its collection. The Night Watch is the most famous Dutch Golden Age painting.


<section id="mysection"> <h2>The Night Watch</h2> <p>The Night Watch (Dutch: De Nachtwacht), is a 1642 painting by Rembrandt van Rijn. It is in the collection of the Amsterdam Museum but is prominently displayed in the Rijksmuseum (State Museum) as the best-known painting in its collection. The Night Watch is the most famous Dutch Golden Age painting. </p></section><br /><button onclick="toggle(this)">Hide Section</button><script> let toggle = button => { let element = document.getElementById("mysection"); let hidden = element.getAttribute("hidden"); if (hidden) { element.removeAttribute("hidden"); button.innerText = "Hide Section"; } else { element.setAttribute("hidden", "hidden"); button.innerText = "Show Section"; } }</script>

Code explanation

Initially, the <section> is visible.

Clicking the button calls JavaScript which toggles the hidden attribute.

With the hidden attribute the section is invisible.

Browser support

Here is when hidden support started for each browser:

HTML section hidden (1)

Chrome

6.0 Sep 2010

HTML section hidden (2)

Firefox

4.0 Mar 2011

HTML section hidden (3)

IE/Edge

9.0 Mar 2011

HTML section hidden (4)

Opera

11.1 Mar 2011

HTML section hidden (5)

Safari

5.0 Jun 2010

You may also like

Back to <section>


HTML section hidden (7)

Last updated on Sep 30, 2023


Earn income with your HTML skills

Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.


Guides

On this page

  • hidden Attribute
  • Example
  • Using hidden
  • Syntax
  • Values
  • More Examples
  • Browser support
  • You may also like
HTML section hidden (2024)
Top Articles
Court injunction pauses CFPB credit card late fee rule
Can I Claim a Deduction for the Cost of a Watch? - Cogniti
Omega Pizza-Roast Beef -Seafood Middleton Menu
Knoxville Tennessee White Pages
Hotels Near 625 Smith Avenue Nashville Tn 37203
El Paso Pet Craigslist
Lamb Funeral Home Obituaries Columbus Ga
How To Do A Springboard Attack In Wwe 2K22
Couchtuner The Office
Gabriel Kuhn Y Daniel Perry Video
Linkvertise Bypass 2023
360 Training Alcohol Final Exam Answers
Nm Remote Access
Housing Intranet Unt
Helloid Worthington Login
Buying risk?
2016 Hyundai Sonata Price, Value, Depreciation & Reviews | Kelley Blue Book
OSRS Dryness Calculator - GEGCalculators
Craigslist Deming
Justified Official Series Trailer
Mani Pedi Walk Ins Near Me
Equipamentos Hospitalares Diversos (Lote 98)
Dignity Nfuse
Napa Autocare Locator
Minnick Funeral Home West Point Nebraska
Vernon Dursley To Harry Potter Nyt Crossword
Bill Remini Obituary
Devotion Showtimes Near Regency Buenaventura 6
Turns As A Jetliner Crossword Clue
Generator Supercenter Heartland
Our 10 Best Selfcleaningcatlitterbox in the US - September 2024
Happy Shuttle Cancun Review
Sf Bay Area Craigslist Com
Tas Restaurant Fall River Ma
School Tool / School Tool Parent Portal
Radical Red Doc
Smith And Wesson Nra Instructor Discount
Ticket To Paradise Showtimes Near Marshall 6 Theatre
Nearest Ups Office To Me
Paperless Employee/Kiewit Pay Statements
2023 Nickstory
Lyndie Irons And Pat Tenore
Interminable Rooms
26 Best & Fun Things to Do in Saginaw (MI)
Hillsborough County Florida Recorder Of Deeds
Craigslist Sarasota Free Stuff
Hsi Delphi Forum
Samantha Lyne Wikipedia
Acellus Grading Scale
Craigslist Centre Alabama
Unity Webgl Extreme Race
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 6074

Rating: 4 / 5 (61 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.