19. Adding JavaScript

While HTML defines your webpage’s content and CSS defines the way it looks, JavaScript defines special behavior. You can’t build a site without HTML (or CSS if you want it to look appealing), but JavaScript is not required. In most cases, JavaScript features enhance your visitor’s experience—they add to the core experience defined by your HTML and CSS. (See “Progressive Enhancement: A Best Practice” in the book’s introduction.)

You can write simple JavaScript programs to show and hide content, and you can write more complicated ones that load data and update your page while your visitor is viewing it. You can build carousels and slideshows ...

Get HTML and CSS: Visual QuickStart Guide, Eighth Edition now with O’Reilly online learning.

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