This assignment asks you to create an image swap that changes two images at once. Do this by putting two image swap statements inside the event handlers.

<html>
<head>
<title>Chapter 4 Assignment</title>
</head>
<body>
<h1>Welcome to the Book of JavaScript Website!</h1>
<p>
<img src = "front_cover.gif" name = "cover">
</p>
<p>
<a href = "#"
  onMouseOver = "window.document.cover.src='back_cover.gif';
      window.document.turn.src='turn_back.gif';"
  onMouseOut = "window.document.cover.src='front_cover.gif';
      window.document.turn.src='turn_over.gif';">
<img src = "turn_over.gif" border = "0" name = "turn">
</a>
</p>
</body>
</html>

Get The Book of JavaScript, 2nd Edition 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.