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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <input> checked-Eigenschaft

Dieser Artikel beschreibt, dass das HTML-input checked-Eigenschaft eine boolesche Eigenschaft ist, die angibt, dass das <input>-Element beim Laden der Seite standardmäßig ausgewählt (markiert) sein sollte.

 HTML <input> Tag

Online-Beispiel

HTML-Formular mit standardmäßig markierten Kontrollkästchen:

<!DOCTYPE html>
<html>
<head>
<title>HTML: <input> checked-Eigenschaft - Grundlagen-Tutorial-Web(oldtoolbag.com)</title>
<body>
<form action="action_page.php" method="get">
  <input type="checkbox" name="vehicle" value="Bike">Mountainbike<br>
  <input type="checkbox" name="vehicle" value="Car" checked>Personenkraftwagen<br>
  <input type="submit" value="Submit">
</form>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the checked attribute.

Definition and Usage

The checked attribute is a boolean attribute.

If present, it specifies that the <input> element should be pre-selected (checked) when the page loads.

The checked attribute can be used with <input type="checkbox"> and <input type="radio"> together.

The checked attribute can also be set after the page has finished loading through JavaScript code.

HTML 4.01 With HTML5Differences

None.

Differences between HTML and XHTML

In XHTML, attribute shorthand is prohibited, the checked attribute must be defined as <input checked="checked" />。

Syntax

<input checked>
 HTML <input> Tag