Message from discussion
Is </OPTION> optional?
Received: by 10.68.125.233 with SMTP id mt9mr22748081pbb.5.1335974021952;
Wed, 02 May 2012 08:53:41 -0700 (PDT)
MIME-Version: 1.0
Path: r9ni123964pbh.0!nntp.google.com!news2.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Barry Margolin <bar...@alum.mit.edu>
Newsgroups: comp.infosystems.www.authoring.html
Subject: Re: Is </OPTION> optional?
Date: Wed, 02 May 2012 11:53:41 -0400
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <barmar-255866.11534102052012@news.eternal-september.org>
References: <j6k2q79ihed6srqhqvkp4c7copob4lmgfv@4ax.com>
Injection-Info: barmar.motzarella.org; posting-host="ePtxJaRXJPFeIWBMlKfZaA";
logging-data="2795"; mail-complaints-to="ab...@eternal-september.org"; posting-account="U2FsdGVkX19btrrQthuh2BB0x7y4eD/5"
User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Cancel-Lock: sha1:qrV4PQmlTyojntAsVpQHcoEzHUw=
In article <j6k2q79ihed6srqhqvkp4c7copob4lm...@4ax.com>,
Swifty <steve.j.sw...@gmail.com> wrote:
> I can't remember where I learned HTML, but I remember that there is no
> </OPTION> tag in HTML (but browsers don't care if you have them)
>
> I've discovered that I sometimes get blank entries in my <SELECT>
> controls, even though none of the <OPTION>'s are blank. This happens
> with the current Opera browser (and back quite a few releases).
>
> The workaround is to add the un-necessary, and possible illegal
> </OPTION> tags.
>
> Presumably this is a problem that I should report to Opera, but I
> thought I'd check my facts first.
You've got it backwards. </OPTION> is legal, but optional in some
contexts.
http://www.w3.org/TR/html5/syntax.html#syntax-tag-omission
says:
An option element's end tag may be omitted if the option element is
immediately followed by another option element, or if it is immediately
followed by an optgroup element, or if there is no more content in the
parent element.
--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***