8.19 onchange, onmouseover, onmouseout

In this section, we provide web page examples that put into practice what you learned earlier about event-handler attributes. Specifically, we’ll use the onchange event-handler attribute to improve the Email Address Generator web page. Then we’ll use onmouseover and onmouseout to implement a rollover in another web page.

Improving the Email Address Generator Web Page with onchange

In the Email Address Generator web page, suppose you want to force the user to enter the first name before the last name. To do that, you can disable the last-name text control initially and remove that restriction after the first-name text control has been filled in. To determine whether the first-name text control has ...

Get Web Programming with HTML5, CSS, and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.