Whats the difference between textarea and input type text in angularjs

TextArea holds multiple lines, input text is only for one line the difference in declaration is as follows

<input name="txtDescEd" type="text"  />
<textarea name="txtDescEd" cols="60" rows="10"></textarea>

Generally speaking an input field is a one-line field (probably to carry something like first name or last name, a phone number, an email). A textarea is a multi-line field that allows you to press ENTER! They are used for addresses or others long and complex type of data (also notes, for instance).


Maybe this is to obvious, but just thought to mention:

  • Textarea value - The value of the textarea object is the html inside of the start and end tags of it.

  • Input value - The input object value of the input is found inside the attribute value.


The difference regards HTML and is not related to AngularJS. Anyway some definitions from the W3Schools site:

input type text:

The <input> tag specifies an input field where the user can enter data.

<input> elements are used within a <form> element to declare input controls that allow users to input data.

An input field can vary in many ways, depending on the type attribute.

Textarea:

The <textarea> tag defines a multi-line text input control.

A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).

The size of a text area can be specified by the cols and rows attributes, or even better; through CSS' height and width properties.

You can find definitions and examples here: input and text area