Forum Moderators: open

Message Too Old, No Replies

Boolean HTML attributes

         

Tonearm

8:27 pm on Oct 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was recently quoted this from the HTML 4.0 spec:

###
B.3.4 Boolean attributes

Authors should be aware that many user agents only recognize the minimized form of boolean attributes and not the full form.

For instance, authors may want to specify: <OPTION selected> instead of <OPTION selected="selected">
###

I didn't know about that at all. Do you guys all code your HTML according to the guideline above?

korkus2000

8:31 pm on Oct 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I do. Usually checked and selected are all that is needed. Some UAs just don't really look at the full attribute.

Tonearm

9:03 pm on Oct 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There aren't any browsers that *can* pick up on selected="selected" but not selected alone are there?

DrDoc

9:32 pm on Oct 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As of XHTML the full form is required.
Just keep in mind that "many user agents only recognize the minimized form" applies to old browsers.

korkus2000

10:27 pm on Oct 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>to old browsers

Thats what I mean. If I am coding HTML 4 then I use the shorthand. XHTML like stated needs the full deal.

g1smd

12:27 am on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ah, I saw <td nowrap="nowrap"> the other day, and wondered what that was all about.

I have always used <td nowrap> myself.

Thanks for the clarification.

Tonearm

4:44 pm on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, I'm all clear on this now. Thanks a lot guys!