English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML-Referenzhandbuch

HTML-Tag-Übersicht

HTML: <input> value-Attribut

Die input value-Eigenschaft legt den Wert des <input>-Elements fest, die value-Eigenschaft wird auf unterschiedliche Weise für verschiedene Eingabetypen verwendet.

 HTML <input> Tag

Online-Beispiel

HTML-Formulare mit einem initialen (standardmäßigen) Wert:

!DOCTYPE html>
<html>
<head>
<title>HTML: <input> value-Attribut - 基础教程网(oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  Benutzername: <input type="text" name="usrname" value="Jack"><br>
  Passwort: <input type="password" name="password" value="123456><br>
  <input type="submit" value="Submit">
</form>
</html>
Testen Sie es heraus ‹/›

Browserkompatibilität

IEFirefoxOperaChromeSafari

Alle gängigen Browser unterstützen das value-Attribut.

Define and usage

The value attribute specifies the value of the <input> element.

The way the value attribute is used for different input types varies:

  • For "button", "reset", "submit" types - Define the text on the button

  • For "text", "password", "hidden" types -  Define the initial (default) value of the input field

  • For "checkbox", "radio", "image" types - Define the value associated with the input element, which will be sent to the form's action URL when the form is submitted.

Note:The value attribute is required for <input type="checkbox"> and <input type="radio">.

Note:The value attribute cannot be used with <input type="file">.

HTML 4.01 with HTML5differences

None.

Syntax

<input value="text">

Attribute value

ValueDescription
textSpecify the value of the <input> element.
 HTML <input> Tag