Glubase - share your knowledge


All / Computers / Programming / HTML / XHTML





  • View Command

HTML / XHTML Reference

HTML / XHTML input definition

Browser support
IEFFOpSaf
FullFullFullFull

Type: inline element

Syntax

<input \>

Description

The input element defines a form control for the user to enter input such as a radio button or a text field.

Attributes

Attribute Description
type

Type of form input:

  • text:
  • password:
  • checkbox:
  • radio:
  • submit:
  • reset:
  • file:
  • hidden:
  • image:
  • button:
name = cdata Key in submitted form.
value = cdata Default value of input.
checked If radio button or check box is checked or not.
size = cdata Suggested number of characters for text input.
maxlength = number Maximum number of characters for text input.
src = uri Source for image.
alt = cdata Alternate text for image input
usemap = uri Client-side image map.
ismap Server-side image map.
align

Alignment of image input.

[ top | middle | bottom | left | right ]

disabled Disables the input.
readonly Prevents changes.
accept = content types Media types for file upload.
acesskey = character Shortcut key.
tabindex = number Position in tabbing order.
onfocus = script Script to run when element recieves focus.
onblur = script Script to run when element lost focus.

Common attributes.

Example

[Try this example yourself]
<form action="somepage.php" method="get">
<input type="submit" name="submit" value="Submit Form" \>
</form>

Output

  • Comments

No comments added.