Re: <select> element @size default

On Thu, Aug 12, 2010 at 2:55 PM, Mike Taylor <> wrote:
> Per the spec, a select element without a required attribute should have its
> size attribute default to 1
> (
> "The size attribute gives the number of options to show to the user. The
> size attribute, if specified, must have a value that is a valid non-negative
> integer greater than zero. If the multiple attribute is present, then the
> size attribute's default value is 4. If the multiple attribute is absent,
> then the size attribute's default value is 1."
> A simple test like alert(document.createElement('select').size == 1) fails
> in the latest versions of Opera, Safari/Chrome, Firefox and IE; in fact,
> they all default to 0.
> Should the spec be changed to document the current behavior, or should we
> try to get the browsers to implement to 1?

I think I'd be fine with attempting to change browsers here. Reading
the .size attribute seems mostly useful if you're dynamically changing
it, and I can't recall ever seeing a site that did that.

/ Jonas

Received on Thursday, 12 August 2010 22:13:51 UTC