HTML <command> checkedAttribute

HTML command 标签参考手册HTML <command> Tag

Example

A pre-selected <command> element:

<menu>
<command type="radio" label="Left" checked
onclick="setAlign('left')">Left</command>
</menu>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 whether a command element should be pre-selected when the page loads.

Note:This attribute can only be used when the command type is set to checkbox or radio, that is, only when type="checkbox" or type="radio".


Differences between HTML 4.01 and HTML5

The <command> tag is new in HTML5.


Differences between HTML and XHTML

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


Syntax

<command checked>


HTML command 标签参考手册HTML <command> Tag Other Extensions