Friday, April 06, 2012

Boolean Attribute vs Boolean Value

If you are writing some thing using HTML5 then you need to understand their Boolean Attributes which is not same as what you think as true or false.Thanks to the Boolean father George Boole

Boolean attribute doesn't need any value set as true or false,  require=required.
Then how to use Boolean Attribute in your HTML ?
just add this attribute and do not assign any value. What .. Yes, its up to you if you want to assign you can.

Lets see the below example.
< input type=text name="user" disabled / >

You can use disabled=disabled or disabled=true.  Both has same meaning or just keep it simple and use "disabled" as I said the very existence of them makes meaning KISS principle

List of HTML5 Boolean Attributes

No comments: