I need to execute the following command $("#title").html( choice# + " wins! ");
but instead of "#", it should be an integer and that should trigger variables I have stored called choice1
- choice10
are variables hence when the code is executed, the string stored in choice1
- choice10
(depending on what is chosen) should show on the innerHTML.
So far I tried $("#title").html( "choice" + position + " wins! ");
where var position;
is a random number and it changes the html to literally "choice3 wins! " (or whatever number it was) instead of printing the string in var choice3;
.