html - Debugging javascript code for generating images -
hey guys need figuring out error in javascript code is.
i know code stops working, can't figure out issue is. can help?
function createcardio(){ var randomimages=new array(); randomimages[0]="images/strength/armcircles.gif"; randomimages[1]="images/strength/calfraises.gif"; /**add more images**/ var preload=new array() (n=0;n<randomimages.length;n++){ preload[n]=new image() preload[n].src=randomimages[n] } if(document.getelementbyid("impact").checked == false && document.getelementbyid("pregnant").checked == false && document.getelementbyid("none").checked == false){ document.getelementbyid("error").innerhtml = "*all fields required"; } else if(document.getelementbyid("beginner").checked == false && document.getelementbyid("intermediate").checked == false && document.getelementbyid("advanced").checked == false){ document.getelementbyid("error").innerhtml = "*all fields required"; } else if(document.getelementbyid("hiit").checked == false && document.getelementbyid("tabata").checked == false && document.getelementbyid("circuit").checked == false){ document.getelementbyid("error").innerhtml = "*all fields required"; } else if(document.getelementbyid("treadmill").checked == false && document.getelementbyid("bike").checked == false && document.getelementbyid("jump").checked == false && document.getelementbyid("equipment").checked == false){ document.getelementbyid("error").innerhtml = "*all fields required"; } else{ if(document.getelementbyid("equipment").checked == true){ if(document.getelementbyid("hiit").checked == true){ if(document.getelementbyid("impact").checked == true && document.getelementbyid("pregnant").checked == true){ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "perform each exercise 40 seconds, followed 20 seconds of rest (10 min)"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; } else if(document.getelementbyid("impact") == true){ if(document.getelementbyid("beginner").checked == true){ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "perform each exercise 40 seconds, followed 20 seconds of rest (10 min)"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[43]+'" width=40% height=40%>'; } else{ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "perform each exercise 40 seconds, followed 20 seconds of rest (10 min)"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; } } else if(document.getelementbyid("pregnant") == true){ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "perform each exercise 40 seconds, followed 20 seconds of rest (10 min)"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*(52-43)+43)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*(52-43)+43)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*(52-43)+43)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; } else{ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "perform each exercise 40 seconds, followed 20 seconds of rest (10 min)"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; } }
this code stops working
else if(document.getelementbyid("tabata").checked == true){ if(document.getelementbyid("impact").checked == true && document.getelementbyid("pregnant").checked == true){ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "perform each exercise 20 seconds, followed 10 seconds of rest (10 min)complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; } else if(document.getelementbyid("impact") == true){ if(document.getelementbyid("beginner").checked == true){ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[43]+'" width=40% height=40%>'; } else{ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; } } else if(document.getelementbyid("pregnant") == true){ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*(52-43)+43)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*(52-43)+43)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*(52-43)+43)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; } else{ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; } } else{ if(document.getelementbyid("impact").checked == true && document.getelementbyid("pregnant").checked == true){ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; } else if(document.getelementbyid("impact") == true){ if(document.getelementbyid("beginner").checked == true){ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*36)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[43]+'" width=40% height=40%>'; } else{ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*44)]+'" width=40% height=40%>'; } } else if(document.getelementbyid("pregnant") == true){ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*(52-43)+43)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*(52-43)+43)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*(52-43)+43)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*15)]+'" width=40% height=40%>'; } else{ document.getelementbyid("input").innerhtml = " "; document.getelementbyid("perform").innerhtml = "complete 3 rounds of 15-20 reps each move"; document.getelementbyid("img1").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img2").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img3").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img4").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img5").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img7").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img8").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img9").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; document.getelementbyid("img10").innerhtml = '<img name="defaultimage" src="'+randomimages[math.floor(math.random()*56)]+'" width=40% height=40%>'; } } } } }
i need figuring out error in javascript code is.
answer: use "error console" in browser see error is. in many browsers, can pressing f12.
Comments
Post a Comment