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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <command> Tag

Der command-Element wird verwendet, um einen Befehl darzustellen, den ein Benutzer aufrufen kann.

Online-Beispiel

Der <command>-Tag kann wie folgt markiert werden:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>Grundlagenkurs(oldtoolbag.com)</title> 
<script>
function save()
{
    alert("Einige JavaScript...");
}
</script>
</head>
<body>
<menu>
<command type="command" label="Save" onclick="save()">Save</command>
</menu>
<p><b>Beachten Sie:</b> Nur IE 9 Der command-Tag wird unterstützt.</p>
</body>
</html>
Testen Sie es heraus ‹/›

Browser-Kompatibilität

IEFirefoxOperaChromeSafari

Derzeit unterstützen alle gängigen Browser den <command>-Tag nicht.

Anmerkung:Nur IE 9 Unterstützt den <command>-Tag, andere IE-Browser in früheren oder späteren Versionen unterstützen den <command>-Tag nicht.

Definition und Verwendung der Tags

Der <command>-Tag kann Befehle definieren, die der Benutzer möglicherweise aufrufen kann (z.B. Radio-Buttons, Checkboxen oder Schaltflächen).

Wenn das <menu>-Element verwendet wird, wird das command-Element als Teil des Menüs oder der Symbolleiste angezeigt. Allerdings kann das command-Element bei der Definition von Tastaturkürzeln an jeder Stelle der Seite platziert werden, ist jedoch unsichtbar.

HTML 4.01 and HTML5difference between

<command> Tag is an HTML 5 New tag in

Attribute

New: HTML5 New attribute in

AttributeValueDescription
checkedHTML5checkedSpecify whether the command is selected when the page is loaded. Only used for radio or checkbox types.
disabledHTML5disabledSpecify whether the command is available.
iconHTML5URLSpecify the URL of the image to be displayed as the command.
labelHTML5textRequired. Specify the name of the command, visible to the user.
radiogroupHTML5groupnameSpecify the group name of the command that can be toggled and will be toggled. Only used when the type is radio.
typeHTML5checkbox
command
radio
Define the type of command. The default is "command".

Global Attributes

Support for <command> Tag Global Attributes of HTML.

Event Attributes

Support for <command> Tag HTML Event Attributes.