Image and HTML Attributes Example

The image macro provides an API for setting img HTML attributes. Providing img attributes does not affect the generated image, but is a convenient way to modify the create img tag.

The following sample demonstrates the use of setting HTML attributes using the image macro.

Smartsite SXML CopyCode image Copy Code
<se:image
    location="SMARTSITELOGO"
    alttext="Image Alt Text"
    classname="myimageclass"
    imageid="image"
    onclick="image_onclick()"
    style="border:1px solid black"/>
Example Result CopyCode image Copy Code
<img id="image" src="/test.net?id=SMARTSITELOGO" alt="Image Alt Text" class="myimageclass" style="border:1px solid black;width:166px;height:56px" onclick="image_onclick()" />