W3C home > Mailing lists > Public > www-validator@w3.org > November 2000

Re: Attributes with no value

From: Eva von Pepel <eva@algonet.se>
Date: Fri, 10 Nov 2000 18:18:51 +0100
Message-Id: <4.3.1.2.20001110170326.00a70460@pop.algonet.se>
To: Kynn Bartlett <kynn@idyllmtn.com>, pdf@bizfon.com, www-validator@w3.org
At 07:12 PM 11/9/00, Kynn Bartlett wrote:
>Actually, an attribute alone means the same thing as attr="attr",
>so <img alt> means the same as <img alt="alt">.

No. This applies to boolean attributes only.

A very small number of HTML-attributes (approx 5?) can take values in form 
of boolean variables. These values are interpreted as "true" when the 
attribute is present or "false" when the attribute is absent, e.g.

<!ATLIST OPTION
         selected (selected) #IMPLIED  >

Boolean attribute can take one single value - itself.  The name of 
attribute type and value type are the same.
<option selected="selected">

As the presence of the attribute alone imples the value to be "true",  the 
value can be omitted - minimized.
<option selected>

/e
Received on Friday, 10 November 2000 12:22:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:54 GMT