JQuery clickin' buttons
<p>I'm making a small game for a school project, and basically there are 20 boxes. 10 boxes have a value of -2, 5 boxes have a value of 2, 3 boxes have a value of 0, and 2 boxes have a value of -5 and 5. So my question is, how can I determine which box was clicked with which value?</p>

<p>Code to initialize my boxes:</p>

<pre><code>shuffle(numbers); // number.length is 20
for(var i = 0; i &lt; numbers.length; ++i)
{
    $('#buttons').append('&lt;button class="boxes" id="' + numbers[i] + '"&gt;' + numbers[i] + '&lt;/button&gt;');
}
</code></pre>

<p>Code that I have tried:</p>

<pre><code>$('#buttons').append('&lt;button class="boxes" id="' + numbers[i] + '" onclick="clicked(this);"&gt;' + numbers[i] + '&lt;/button&gt;'); // made function called clicked with alert in return

$('button#-2).click(function () {
    alert('Clicked on -2 box');
});
</code></pre>

<p>But it seems like none of this code seems to show me an alert for which box I clicked. Am I missing something?</p>
