Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Disabled = ture for html work?

I noticed in our code that there is a disabled = ture' i the source code for anchor tag. I was wondering why it works in IE. I also searched the internet and it is also being used in a lot of source code via a search in the net. I have been searching if ture, a wrong spelling of true can also be used by IE.

Does anybody have any idea about this?

like image 606
Nap Avatar asked Dec 06 '22 04:12

Nap


2 Answers

It used to be that to disable an element, you just did <input type="text" disabled>, so most browsers don't really care what goes in that attribute. I believe making it disabled="disabled" became a standard solely so that the code would be valid XML.

like image 151
davidtbernal Avatar answered Dec 23 '22 08:12

davidtbernal


IE only checks for the existence of the disabled property. It's value doesn't matter.

like image 41
Zed Avatar answered Dec 23 '22 07:12

Zed