I'm using the jquery method $(this).html() to get the value of a button.
It works fine when I assign the value to a variable (like x = $(this).html();
)
But won't work when I try to assign the value to an array (like expression[1] = $(this).html();
)
A
// expression = array();
$(document).ready(function()
{
$(".operator").click(function(){
expression[0] = $(this).html(); //
alert(expression[0]); // Won't work
// x = $(this).html(); // Works
// alert(x); //
});
});
What am I doing wrong?