View on GitHub

reading-notes

Reading Notes about Markdown-Html-Css-JavaScript

Forms

HTML form is used to collect user input. The user input is most often sent to a server for processing.

<form>
.
form elements
.
</form>
Type Description
< input type=”text”> Displays a single-line text input field
< input type=”radio”> Displays a radio button (for selecting one of many choices)
< input type=”checkbox”> Displays a checkbox (for selecting zero or more of many choices)
< input type=”submit”> Displays a submit button (for submitting the form)
< input type=”button”> Displays a clickable button

////////////////////////////////////////////

Notice the use of the < label> element in the example above. The < label> tag defines a label for many form elements.

The < label> element is useful for screen-reader users, because the screen-reader will read out loud the label when the user focus on the input element.

Radio buttons let a user select ONE of a limited number of choices.

Checkboxes let a user select ZERO or MORE options of a limited number of choices.

The HTML < form> element can contain one or more of the following form elements:

list

x- The addEventListener() method attaches an event handler to an element without overwriting existing event handlers.

element.addEventListener(event, function, useCapture);

Notes :