Chapter 16. Dynamic HTML

While terms like HTML, XHTML, CSS, and JavaScript all refer to specific technologies, Dynamic HTML (DHTML) refers not to a discrete feature but to a collection of technologies and a way of bringing a web page to life. DHTML involves the use of JavaScript to control HTML on the page by manipulating the DOM and elements on the page using CSS. There is some ambiguity in the development community over whether DHTML is in fact different from approaches like Progressive Enhancement, Ajax, or DOM Scripting. For the most part, these terms all refer to much the same thing, and what you do with these approaches can also be considered Dynamic HTML because they involve the use of JavaScript, CSS, and the DOM.

Under the umbrella of DHTML lies a wide array of possible effects and interactions you can produce. Most of the things you may have seen in a web browser that go outside the bounds of static HTML like modal windows, drag and drop, and simple animation are achieved with DHTML. There's a surprisingly large amount of innovation possible in this respect through creative application of some of the core concepts you've already read about, including object-oriented development, the unobtrusive event model, the DOM, and CSS.

There's been a fair amount of criticism of DHTML techniques over the years. Some people assume that if you use dynamic features in a browser, it won't be accessible. Others insist that differences among browsers make debugging and generally providing ...

Get JavaScript® Programmer's Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.