Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

HTML <menuitem> icon Attribute

❮ HTML <menuitem> tag

Example

Specify icons for different <menuitem> elements:

<menu type="context" id="mymenu">
  <menuitem label="Refresh" icon="ico_reload.png"></menuitem>
  <menuitem label="Twitter" icon="ico_twitter.png"></menuitem>
  <menuitem label="Facebook" icon="ico_facebook.png"></menuitem>
</menu>
Try it Yourself »

Definition and Usage

The icon attribute specifies an image that represents the command/menu item.


Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Attribute
icon Not supported Not supported 8.0 Not supported Not supported

Syntax

<menuitem icon="URL">

Attribute Values

Value Description
URL Specifies an icon for the menu item.

Possible values:

  • An absolute URL - points to another web site (like icon="http://www.example.com/reload.jpg")
  • A relative URL - points to a file within the web site (like icon="reload.jpg")

❮ HTML <menuitem> tag