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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <input> required Eigenschaft

Das Attribut input required ist ein boolches Attribut. Wenn das Attribut required vorhanden ist, wird angegeben, dass das Eingabefeld ausgefüllt werden muss, bevor das Formular eingereicht wird.

 HTML <input> Tag

Online-Beispiel

HTML-Formular mit obligatorischem Eingabefeld:

<!DOCTYPE html>
<html>
<head>
<title>HTML: <input> required Eigenschaft - Grundlegendes Tutorial-Netz(oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  Benutzername: <input type="text" name="usrname" required>
  <input type="submit">
</form>
</html>
Testen, sehen Sie ‹/›

Browser Kompatibilität

The numbers in the table indicate the first browser version that supports the attribute.

Attribute




required5.010.04.05.09.6

Definition and Usage

The required attribute is a boolean attribute.

If the required attribute exists, it specifies that the input field must be filled out before submitting the form.

Note:The required attribute applies to the following input types: text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file.

HTML 4.01 with HTML5differences

The required attribute is an HTML5 with the new attributes.

Differences between HTML and XHTML

In XHTML, attribute abbreviations are prohibited, the required attribute must be defined as <input required="required" in XHTML. />。

Syntax

<input required>
 HTML <input> Tag