[whatwg] WF 2.0 -- HTMLTextAreaElement [ type ] attribute

Magnus Kristiansen magnusrk+whatwg at pvv.org
Sat Sep 15 17:19:00 PDT 2007

On Fri, 14 Sep 2007 02:52:33 +0200, Garrett Smith <dhtmlkitchen at gmail.com>  

> Regarding the [type] attribute:
> ================================================
> interface HTMLTextAreaElement : HTMLElement {
>            attribute DOMString       defaultValue;
>   readonly attribute HTMLFormElement form;
>            attribute DOMString       accessKey;
>            attribute long            cols;
>            attribute boolean         disabled;
>            attribute DOMString       name;
>            attribute boolean         readOnly;
>            attribute long            rows;
>            attribute long            tabIndex;
>   readonly attribute DOMString       type;
> ================================================
> What does the |type| attribute do?

Input has .type, to mirror the attribute. The fact that both select  
(redundant with .multiple) and textarea (always the same) also have .type  
suggests to me it was intended to allow a unified view of all form  
controls. You can check .type directly without having to bother with  
checking the .tagName or similar first.

Magnus Kristiansen
"Don't worry; the Universe IS out to get you."

More information about the whatwg mailing list