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

Online Tools

Reference Manual

: <progress> Tag

HTML: <command> checked Attribute

 HTML <command> tag

This article introduces the usage of the HTML command checked attribute, with online examples demonstrating how to use the HTML command checked attribute, browser compatibility, syntax definition, and detailed information about its attribute values.

Online Example

Example
<!DOCTYPE html>
<html>
<head>-8><meta charset="utf
<title>HTML <command> checked Attribute Usage-Basic Tutorial(oldtoolbag.com)</b>/title>
<script>
function setAlign()
{
    alert("Some JavaScript....");
}
</script>
</head>
<body>
<menu>
<command type="radio" label="Left" checked onclick="setAlign('left')</b>Left/command>
<command type="radio" label="Center" onclick="setAlign('center')</b>Center/command>
<command type="radio" label="Right" onclick="setAlign('right')</b>Right/command>
</menu>
<p><b>Attention:</b>/Currently, almost all mainstream browsers do not support the 'checked' attribute./p>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Currently, almost all mainstream browsers do not support the checked attribute.

Definition and Usage

The checked attribute is a boolean attribute.

The checked attribute specifies that the command element should be pre-selected when the page is loaded.

Note:The checked attribute can only be used when the command type is set to checkbox or radio, i.e., only when type="checkbox" or type="radio".

HTML 4.01 between5differences

The <command> tag is an HTML5 new tags.

Differences between HTML and XHTML

In XHTML, attribute minimization is prohibited, the checked attribute must be defined as <command checked="checked">.

Syntax

<command checked>

 HTML <command> tag