I'm trying to change the value of my button with jQuery.
This is what i have in html:
<button id="choice1">John</button>
And this is what I've tried to change the value:
$(document).ready(function(){
$("#choice1").click(function(){
$(this).val("Mike");
});
});
I even tried .attr / .prop / .html / .text
instead of .val
but none of them worked.
Ok so if I'm trying to change it to an Array like this:
var a = new Array(4000)
a[2][1] = "North"
a[2][2] = "South"
a[2][3] = "East"
a[2][4] = "West"
And the function:
function state1gmg(){
$(document).ready(function(){
$("div#gamestatesdiv").text(state1);
});
$(document).ready(function(){
$("div#questionsdiv").text(q[1]);
});
$(document).ready(function(){
$("#choice1").click(function(){
$(this).html(a[2][1]);
});
});
}
Any help? Thanks in Advance!!