topical media & game development

talk show tell print

basic-javascript-05-ch5-examp3.htm / htm



  <html>
  <body>
  <img name="img1" src="" border="0" width="200" height="150">
  <script language="JavaScript" type="text/javaScript">
     var myImages = new Array("usa.gif","canada.gif","jamaica.gif","mexico.gif");
     var imgIndex = prompt("Enter a number from 0 to 3","");
     document.images["img1"].src = myImages[imgIndex];
  </script>
  </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.