Alex Rivera | Logout

What is the correct value for the disabled attribute?

Asked 2011-08-05T19:19:39.510
183

What is the correct value for the disabled attribute for a textbox or textarea?

I've seen the following used before:

<input type="text" disabled />
<input type="text" disabled="disabled" />
<input type="text" disabled="true" />
Edit
Report

1 Answer

153
  • For XHTML, <input type="text" disabled="disabled" /> is the valid markup.
  • For HTML5, <input type="text" disabled /> is valid and used by W3C on their samples.
  • In fact, both ways works on all major browsers.
answered 2011-08-05T19:48:18.447

Your Answer