W3Schools.com (2024)

Definition and Usage

The disabled attribute is a boolean attribute.

When present, it specifies that the element should be disabled.

A disabled element is unusable.

The disabled attribute can be set to keep a user from using the elementuntil some other condition has been met (like selecting a checkbox, etc.). Then, a JavaScript could remove the disabled value, and make the element usable again.

Applies to

The disabled attribute can be used on the following elements:

ElementsAttribute
<button>disabled
<fieldset>disabled
<input>disabled
<optgroup>disabled
<option>disabled
<select>disabled
<textarea>disabled

Examples

Button Example

A disabled button:

<button type="button" disabled>Click Me!</button>

Try it Yourself »

Fieldset Example

Disable a group of related form elements:

<fieldset disabled>
<legend>Personalia:</legend>
Name: <input type="text"><br>
Email: <input type="text"><br>
Date of birth: <input type="text">
</fieldset>

Try it Yourself »

Input Example

An HTML form with a disabled input field:

<form action="/action_page.php">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname" disabled><br>
<input type="submit" value="Submit">
</form>

Try it Yourself »

Optgroup Example

A disabled option-group:

<select>
<optgroup label="German Cars" disabled>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>

Try it Yourself »

Option Example

A drop-down list with one disabled option:

<select>
<option value="volvo" disabled>Volvo</option>
<option value="saab">Saab</option>
<option value="vw">VW</option>
<option value="audi">Audi</option>
</select>

Try it Yourself »

Select Example

A disabled drop-down list:

<select disabled>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>

Try it Yourself »

Textarea Example

A disabled text area:

<textarea disabled>
At w3schools.com you will learn how to make a website. We offer free tutorials in all web development technologies.
</textarea>

Try it Yourself »

Browser Support

The disabled attribute has the following browser support for each element:

Element
button Yes Yes Yes Yes Yes
fieldset Yes Not supported Yes 7.0 Yes
input 1.0 6.0 1.0 1.0 1.0
optgroup 1.0 8.0 Yes Yes Yes
option 1.0 8.0 1.0 Yes Yes
select Yes Yes Yes Yes Yes
textarea Yes Yes Yes Yes Yes

W3schools Pathfinder

Track your progress - it's free!

W3Schools.com (2024)
Top Articles
Re: cannot buy skin with legend tokens
LifeLock Standard™ Plan - ID theft protection beyond credit monitoring
Omega Pizza-Roast Beef -Seafood Middleton Menu
Tryst Utah
Asist Liberty
Week 2 Defense (DEF) Streamers, Starters & Rankings: 2024 Fantasy Tiers, Rankings
Frank Lloyd Wright, born 150 years ago, still fascinates
How To Be A Reseller: Heather Hooks Is Hooked On Pickin’ - Seeking Connection: Life Is Like A Crossword Puzzle
Meer klaarheid bij toewijzing rechter
Lost Ark Thar Rapport Unlock
Vanadium Conan Exiles
CHESAPEAKE WV :: Topix, Craigslist Replacement
Tabler Oklahoma
Craigslist Free Grand Rapids
Ou Class Nav
Jayah And Kimora Phone Number
How to Watch the Fifty Shades Trilogy and Rom-Coms
Leccion 4 Lesson Test
Morristown Daily Record Obituary
Talkstreamlive
Gazette Obituary Colorado Springs
Understanding Gestalt Principles: Definition and Examples
Getmnapp
Inkwell, pen rests and nib boxes made of pewter, glass and porcelain.
Mineral Wells Skyward
6892697335
Pioneer Library Overdrive
Harrison County Wv Arrests This Week
Movies - EPIC Theatres
Nikki Catsouras: The Tragic Story Behind The Face And Body Images
Elanco Rebates.com 2022
5 Star Rated Nail Salons Near Me
Rund um die SIM-Karte | ALDI TALK
Nail Salon Open On Monday Near Me
Lil Durk's Brother DThang Killed in Harvey, Illinois, ME Confirms
Beth Moore 2023
#scandalous stars | astrognossienne
Final Exam Schedule Liberty University
Ktbs Payroll Login
Improving curriculum alignment and achieving learning goals by making the curriculum visible | Semantic Scholar
“To be able to” and “to be allowed to” – Ersatzformen von “can” | sofatutor.com
Nina Flowers
John M. Oakey & Son Funeral Home And Crematory Obituaries
Trending mods at Kenshi Nexus
Lawrence E. Moon Funeral Home | Flint, Michigan
Unit 11 Homework 3 Area Of Composite Figures
Windy Bee Favor
Canonnier Beachcomber Golf Resort & Spa (Pointe aux Canonniers): Alle Infos zum Hotel
Craigslist Pets Charleston Wv
Rubmaps H
The Ultimate Guide To 5 Movierulz. Com: Exploring The World Of Online Movies
Scholar Dollar Nmsu
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 5979

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.