Hide and Show

We can use Hide and Show techniques to enhance interactivity in web pages.

Popups Here is an example of using javascript to create popup boxes that appear as the mouse moves over an image.

Using javascript we can control the visibility of parts of a web page, hiding or showing images or text according to some event.

In the past this has been tricky because different browsers used different Doms and hence different code to control visibility.

For example, assume we wish to hide a graphic called 'picture'.
In Netscape 4 we would write the following javascript,

document.picture.visibility='hide'

In earlier versions of IE we would write the following javascript,

document.all['picture'].style.visibility='hidden'

In order to accommodate various browsers separate sets of web pages were used.
Alternatively techniques such as Browser Sniffing and Syntax Patching were required.

Now it is much simpler.