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

HTML 参考手册

HTML tag大全

HTML: <command> icon attribute

This article introduces the HTML command icon attribute that specifies the image representing the command element, with online examples demonstrating how to use the HTML command icon attribute, browser compatibility, syntax definition, and detailed information about its attribute values.

 HTML <command> tag

在线示例

代表 <command> 元素的图像:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <command> icon 属性使用-基础教程(oldtoolbag.com)</title>
<script>
function setAlign()
{
    alert("Some JavaScript....");
}
</script>
</head>
<body>
<menu>
<command type="radio" label="Left" icon="left.png" onclick="setAlign(&"39;left');Left</command>
<command type="radio" label="Center" icon="center.png" onclick="setAlign(&"39;center');Center</command>
<command type="radio" label="Right" icon="right.png" onclick="setAlign(&"39;right')>Right</command>
</menu>
<p><b>Notice:</b>Currently, almost all mainstream browsers do not support the icon attribute.</p>
</body>
</html>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

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

Definition and Usage

The icon attribute specifies the image representing the command element.

HTML 4.01 with HTML5differences

<command> tag is part of HTML5 in the new tag.

Syntax

<command icon="URL">

Attribute value

ValueDescription
URLSpecifies the image representing the command.

Possible values:

  • Absolute URL - Points to another website (for example icon="http://www.example.com/lamp.jpg")

  • Relative URL - Points to a file within the website (for example icon="lamp.jpg")

 HTML <command> tag