Rollover text, for instance, is a DHTML feature which changes the attributes of text, as it appears on the browser, when the cursor pointer passes over it. A common use of this feature is to make the text larger and therefore more legible. This could be used for links or for important information such as the phone number of an organization to which the web site refers.
Another use for this feature is to replace
images with other images when the pointer passes over it. The code for this dynamic change is:
<DIV> onMouseOver="aa.src='image2.gif'" onMouseOut="aa.src='image1.gif'" > <IMG SRC="image1.gif" ID="aa"> </DIV>
In this sample code aa denotes the assigned ID of the dynamic feature,
image1.gif is the image which appears first and which returns when the pointer moves off the image,
and image2.gif is the image which appear when the pointer passes over the first image.
Style sheets are a particularly useful type of feature which are included in the DHTML category. They can save the coder a lot of time by establishing a simple way of setting styles. This can be done in three ways: