Forms & Input

We use HTML forms to gather input from the user.

<form> ........form elements...... </form>

Some of the form elements we use are:

<input> (with various input types)

<select> (a drop-down list to choose from)

<option> (the items you can choose from)

<textarea> (a larger input area for longer pieces of text)

<button> (a clickable button that then causes something to happen)

Various attributes we use with form elements are:

type (text, radio, submit, color, email, date, datetime, datetime-local, number, time . . .)

action (defines what happens when the form is submitted)

method (the technical way that the form is submitted)

name (names each field in the form)

value (pre-fills a value in the field)

placeholder (puts a suggestion in the field, but doesn't pre-fill it)

size (size of the field, in characters)