The DHTML capabilities (such as changing the text color/fonts/size dynamically) are very nice features to have, but unfortunately, they are not available on all browser applications. Essentially, DHTML features work only on the Internet Explorer Web browser. This example explains how to achieve dynamic features within a normal HTML document even on browsers like Netscape Navigator. The method explained here makes use of the ‘innerHTML’ property of the
objects in the Internet Explorer and the ‘layer’ objects in Netscape Compatible browsers.
The example below explains how to use the
tags:
The following JavaScript method is called on by clicking the form button (changing the contents could happen on any other event like onmousemove, onmouseout etc.).
Here the Internet Explorer makes use of the
tags, whereas Netscape Navigator makes use of the ‘layer’ object to dynamically change its content. Using this method and a little bit of imagination, you can add some ‘dynamism’ to your Web pages on any browser.