I'm trying to change the face value of buttons using an array but what I've got doesn't seem to be working.
$(document).ready(function(){
var buttonValues = ["The letter 1", "The letter 2", "The letter 3", "The letter 4", "The letter 5"];
var randomNumber = Math.floor((randomImages.length)*Math.random());
$(".answer").text(buttonValues[randomNumber]);
});
JQuery above and the HTML below.
<button class="answer" id="1">a</button><br>
<button class="answer" id="2">b</button><br>
<button class="answer" id="3">c</button><br>
Any help would be appreciated, very new to jQuery. I have a couple of other functions going on in the JS file so will post a fiddle of the full code. I may have wrapped something wrong for all I now. Again very new to this. fiddle of current progress
Thanks for the help everyone, realised the silly mistake I made with the code but got some extra advice as well.