English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

can anyone tell whats wrong with this code? Its suppose to ask you to pick a number between 0 to 4 and display an image.








any tips would be helpful.

2006-07-25 15:10:13 · 2 answers · asked by wormhole 2 in Computers & Internet Programming & Design

2 answers

var myImages = new Array("image1.gif","image2.jpg...

^ "..." should be replaced with proper close


var imgIndex = prompt("Enter a number between 0 to 4","");

^ This line should be

var imgIndex = prompt("Enter a number between 0 to 4");



document.images["img1"].scr = myimages[imgIndex];

^ src is spelled wrong.

2006-07-25 15:15:17 · answer #1 · answered by erkzh 2 · 1 0

for your information, you are refering to Java Script there, not Java programming. tips, becareful with your punctuations usage when in scripting and programming, and learn to tab your codes properly line by line for ease of view and checking.

2006-07-25 23:25:42 · answer #2 · answered by dranagar 5 · 0 0

fedest.com, questions and answers