Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why select is not a input type in HTML?

Why for example <select> and <textarea> are stand alone tags instead of attributes of <input>?

like image 360
ycshao Avatar asked Mar 23 '16 02:03

ycshao


People also ask

Is select an input type in HTML?

The <select> element is most often used in a form, to collect user input. The name attribute is needed to reference the form data after the form is submitted (if you omit the name attribute, no data from the drop-down list will be submitted). The id attribute is needed to associate the drop-down list with a label.

Is select an element in HTML?

<select>: The HTML Select element. The <select> HTML element represents a control that provides a menu of options.

Which of the following is not an HTML input type?

Which of the following is not a type of attribute for input tag? Explanation: Day is not defined in the pre-defined attribute list of input tag. Week attribute defines week and year when used as attribute in input tag. Month specifies month and year when it is accessed in input tag.

What is input select?

Input Text select() Method The select() method is used to select the content of a text field.


1 Answers

<select> is a nested HTML Element, whereas <input> is not. For example <select> element contains <option> elements nested within it.

As far as textarea is concerned, 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.)

I guess this is the reason why we have seperate tags for these elements.

like image 108
SachinSunny Avatar answered Sep 28 '22 23:09

SachinSunny