Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.
<input id='input1' type='text'></input>
<input id='input2' type='button'></input>
<input id='input3' type='checkbox'><input>
<textarea id='myTextArea'></textarea>

In HTML markup, most places where the user can interact with the page are denoted with the <input> tag. Why is it that textarea has its own tag, <textarea> as opposed so, say, <input type='textarea'>

share|improve this question

closed as off topic by Mark Trapp Jan 28 '12 at 2:39

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Lots of good answers here: stackoverflow.com/questions/5637326/… –  grahamparks Dec 28 '11 at 20:59

3 Answers 3

up vote 7 down vote accepted

Because <textarea> has the rows and cols attributes that are specific to it. If it were a type of <input>, these attributes would have to be part of the <input> tag even though they serve no purpose for the other types.

share|improve this answer
Strangely, though, <input type="checkbox"> and <input type="radio"> have a checked attribute not used by any other input type. Similarly, <input type="image"> shares attributes with the <img> tag. Additionally, <input type="button"> shares functionality with the <button> tag. –  greyfade Dec 28 '11 at 19:32
@greyfade: Let he whose incremental designs are completely consistent cast the first stone... –  Michael Borgwardt Dec 28 '11 at 19:46
@MichaelBorgwardt where can I buy that t-shirt? :) –  Adrian J. Moreno Dec 28 '11 at 20:51

Okay, @maple_shaft's answer got me curious, so after about 20 minutes of Googling...

From one of the original HTML drafts:

NOTE: In the initial design for forms, multi-line text fields were supported by the Input element with TYPE=TEXT. Unfortunately, this causes problems for fields with long text values. SGML's default (Reference Quantity Set) limits the length of attribute literals to only 240 characters. The HTML 2.0 SGML declaration increases the limit to 1024 characters.

So no, it did not have to do with rows and cols being unique to textarea, like the accepted answer claims.

share|improve this answer
The currently accepted answer is decidedly not correct. The stackoverflow question linked to in grahamparks comment also has accurate answers (stackoverflow.com/questions/5637326/…). –  qes Jan 28 '12 at 1:52
@Izkata Thanks for finding and posting this! Most people wouldn't have cared enough to revive an old question with new information. –  maple_shaft Jan 29 '12 at 22:54
@maple_shaft I've often wondered the same thing, though, but didn't really have an idea where to start searching. Got the idea from your answer (Plus this one isn't that old, I've posted new stuff to SciFi.SE for Star Trek after a year or more (^_~) ) –  Izkata Jan 29 '12 at 23:30

To understand why the textarea is a unique tag compared to the other input fields you would have needed to be in the original message chains between Conolly and Berners-Lee in the years leading up to the release of the HTML 2.0 standard that came out in 1995. Why it is not a standard input tag like everything else may have been because of a technical difficulty at the time or some general compromise that they had agreed upon.

For the original HTML 2.0 specification on HTML Forms see here: http://tools.ietf.org/html/rfc1866#section-8

At one point someone had found the original AOL message boards and posted them publicly where they were going back and forth discussing the various prototypes that led up to HTML as we know it today. It was intensely interesting but I can't seem to find it anymore.

share|improve this answer
Hopefully someone can find it. –  CaffGeek Dec 28 '11 at 20:29
@Chad - I didn't find the messages, but see my just-posted answer –  Izkata Jan 27 '12 at 22:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.