JavaScript Tutorial - 9 - possible answer to Task 25
<html> <head> <title>Flip</title> <script> var n=1 function flip() { n++ if (n==3) { n=1 } if (n==1) { document.images["bighat"].src="bighat.gif" } if (n==2) { document.images["bighat"].src="bighat_reverse.gif" } } </script> </head> <body> <img src=bighat.gif name=bighat width=98 height=128> <form> <input type=button value="flip image" onClick=flip()> </form> </body> </html>
HOME Table of Contents