XUL Programmer's Reference Manual

<image>

Attributes Common Children
src  
id  
class  
onclick  

The <image> element provides a simple way to include images in your interface development. Many more complex XUL widgets, such as the menubutton, are created out of combinations of <text> widgets, <image> widgets, and others. src, the most commonly-used attribute on the <image>, is used to reference images:

<box style="background-color: lightgrey;" 
    orient="vertical" 
    autostretch="never">
  <image src="moz_icon.gif" />
  <text value="Icon" />
</box>

The three buttons defined as child elements of the stack are interpolated into what looks like a single button.

 

src
Description
src is the main attribute for associating image files with XUL image widgets. 
Syntax
<image src="image file" />
Example
<image src="giffy.gif" />
...
Notes

None.

 
 
 
onclick
Description
onclick is an event listener attribute for adding functionality to image widgets. 
Syntax
<image src="image file" onclick="javascript statements or javascript function call"
Example
<image src="giffy.gif" onclick="location='http://www.spamcentral.com'" />
...
Notes

The click event is fired whenever the user clicks the image.

 
 
 

 
Last updated: 8/10/00 Ian Oeschger