0
[Solved] Can anyone figure out what's wrong in my code?
Why only 5 and 6 come up on clicking the button? https://code.sololearn.com/Wd7QvYer8elF/?ref=app
3 Answers
+ 2
because you write a serie of 'if', and on last (num==5) you add an 'else'...
so finally, if num==5 src is set to dice 5, else src is set to dice 6, despite another one was attributed previously ^^
instead of if..else if..else, I would advise to just do:
img.src = images[num];
;)
+ 2
Thanks visph đ€đ€
0
visph sir please help in this: https://www.sololearn.com/Discuss/2812945/?ref=app