How to Use the Dojo Tooltip Widget - Getting some color into the tooltip
(Page 4 of 7 )
Perhaps what you saw in the previous example is similar to what can be achieved by HTML's title attribute. But this is not all. Dojo can do a lot more. This next snippet can pop open a whole HTMLl file by using the dojoTooltip's other attributes. The dojoType tooltip gets connected to the object through its id property as in the previous example.
<!--Button-->
<input type=text id="myBox" value="This box">
<span dojoType="tooltip"
connectId="myBox"
href="http://localhost/DojoAjax/tooldoc2.htm"
executeScripts="true" </span>
<!--end button-->
Just plug in the previous snippet between the comment that reads <!--Button- -> .....<!--end button-->. When you open the page in browser you will see the following display.

Of course you need to have this tooldoc2.htm in the root directory whose source code is shown here. While both HTML attributes as well as inline CSS work, linked style does not get rendered.
<HTML>
<HEAD>
<TITLE>Tooldoc2 htm file </TITLE>
</HEAD>
<BODY>
<h2 style="color:magenta;
font-weight:bold;
background-color:yellow;
width:80px;">Test</h2>
<h3><font color="blue">Test again</font></h3>
</body>
</html>
Next: How about an image in the tooltip? >>
More JavaScript Articles
More By Jayaram Krishnaswamy