DHTML Examples

Soon, this will be an index page for the numerous DHTML examples on this site. I've got a lot of little examples and test pages lying around where I've figured out little problems or shown someone how to accomplish this or that effect. As I gather them up, figure out what I was trying to do, and update them for XHTML/DOM, I'll post them here.

What is DHTML?

DHTML, or Dynamic HTML, is a means of adding dynamic content to otherwise static web pages. The drop-down menu at the top of this page (visible only in CSS2- and DOM-compliant browsers) is an example of DHTML.

A common definition of DHTML is markup plus CSS (Cascading Style Sheets) plus client-side script.

Hiding and Showing Layers

The dynamic hiding and showing layers is commonly used for DHTML menus and rollover information boxes. This simple example shows how it's done.

Dynamic Content

The DOM as implemented by Mozilla (and thereby Netscape 6) and IE 5 and later allows for the dynamic insertion of HTML code.

Option Copy

This example comes from a problem that I had to figure out when I wanted to move information from one list to another one as I clicked on items in a list. It also has other applications, as it shows how to move information into and out of a select control dynamically.