24.5. Using JavaScript to Make Pages Dynamic

In most of the previous examples, parts of the document were built dynamically (when the page was loaded), but the resultant document was normal HTML. JavaScript can also be used to create elements that are dynamic. For instance, one common application is to create images that change when the user moves the mouse over them. This application can be used to implement toolbars with regions that “light up” to indicate hypertext links or custom buttons that show a grayed-out image when you press them. Alternatively, by using timers, JavaScript can animate images even without being triggered by user events. JavaScript can manipulate layers, scroll the document, and even move the browser window around on ...

Get Core Web Programming, Second Edition now with O’Reilly online learning.

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