Sams Teach Yourself HTML in 10 Minutes (4th Edition)

Forms create an interface for the user to select options and return data to the Web server.

<button>...</button>

Usage

Creates a button.

Attributes

core, i18n, events.

name="..." The button name.

value="..." The value of the button.

type="..." The button type (button, submit, reset).

disabled="..." Sets the button state to disabled.

tabindex="..." Sets the tabbing order between elements with a defined tabindex.

onfocus="..." The event that occurs when the element receives focus.

onblur="..." The event that occurs when the element loses focus.

<form>...</form>

Usage

Creates a form that holds controls for user input.

Attributes

core, i18n, events.

action="..." The URL for the server action.

method="..." The HTTP method (get, post). get is deprecated.

enctype="..." Specifies the MIME (Internet media type).

onsubmit="..." The intrinsic event that occurs when the form is submitted.

onreset="..." The intrinsic event that occurs when the form is reset.

target="..." Determines where the resource is displayed (user-defined name, _blank, _parent, _self, _top).

accept-charset="..." The list of character encodings.

<input />

Usage

Defines controls used in forms.

Attributes

core, i18n, events.

type="..." The type of input control (text, password, checkbox, radio, submit, reset, file, hidden, image, button).

name="..." The name of the control (required except for submit and reset).

value="..." The initial value of the control (required for radio and checkboxes).

checked="checked" Sets the radio buttons to a checked state.

disabled="..." Disables the control.

readonly="..." For text password types.

size="..." The width of the control in pixels except for text and password controls, which are specified in number of characters.

maxlength="..." The maximum number of characters that can be entered.

src="/books/1/174/1/html/2/..." The URL to an image control type.

alt="..." An alternative text description.

usemap="..." The URL to a client-side imagemap.

tabindex="..." Sets the tabbing order between elements with a defined tabindex.

onfocus="..." The event that occurs when the element receives focus.

onblur="..." The event that occurs when the element loses focus.

onselect="..." Intrinsic event that occurs when the control is selected.

onchange="..." Intrinsic event that occurs when the control is changed.

accept="..." File types allowed for upload.

<label>...</label>

Usage

Labels a control.

Attributes

core, i18n, events.

for="..." Associates a label with an identified control.

disabled="..." Disables a control.

accesskey="..." Assigns a hotkey to this element.

onfocus="..." The event that occurs when the element receives focus.

onblur="..." The event that occurs when the element loses focus.

<legend>...</legend>

Usage

Assigns a caption to a fieldset.

Attributes

core, i18n, events.

accesskey="..." Assigns a hotkey to this element.

<option>...</option>

Usage

Specifies choices in a <select> element.

Attributes

core, i18n, events.

selected="selected" Specifies whether the option is selected.

disabled="disabled" Disables the control.

value="..." The value submitted if a control is submitted.

<select>...</select>

Usage

Creates choices for the user to select.

Attributes

core, i18n, events.

name="..." The name of the element.

size="..." The height in number of visible rows.

multiple="multiple" Allows multiple selections.

disabled="disabled" Disables the control.

tabindex="..." Sets the tabbing order between elements with a defined tabindex.

onfocus="..." The event that occurs when the element receives focus.

onblur="..." The event that occurs when the element loses focus.

onselect="..." Intrinsic event that occurs when the control is selected.

onchange="..." Intrinsic event that occurs when the control is changed.

<textarea>...</textarea>

Usage

Creates an area for user input with multiple lines.

Attributes

core, i18n, events.

name="..." The name of the control.

rows="..." The height in number of rows.

cols="..." The width in number of columns.

disabled="disabled" Disables the control.

readonly="readonly" Sets the displayed text to read-only status.

tabindex="..." Sets the tabbing order between elements with a defined tabindex.

onfocus="..." The event that occurs when the element receives focus.

onblur="..." The event that occurs when the element loses focus.

onselect="..." Intrinsic event that occurs when the control is selected.

onchange="..." Intrinsic event that occurs when the control is changed.

Notes

Text to be displayed is placed within the start and end tags.

Категории