Creating a board game with javascript
<p>I am trying to create a game like jeopardy where the user clicks on a button and gets a question they need to answer. The problem is I can't tell which square was clicked and I also can't hide the board from the user when they're answering a question. I am fairly unfamiliar with javascript and I wouldn't mind using a library or a plug-in. </p>

<p>Edit: </p>

<p>I'm sorry if my question wasn't in the right format this is my first question here. So what I have so far is this: </p>

<p>function fillBoard(width,height)
{
    var stepWorth = 100; </p>

<pre><code>var board = document.getElementById("buttonsFrame")
while(board.firstChild)
    board.removeChild(board.firstChild)

var spans = new Array(width)
for(var i = 0; i&lt;width; i++)
{
    spans[i] = document.createElement("span")
    spans[i].parent = board
    board.appendChild(spans[i])
}

for(var h = 0; h &lt; height; h++)
{
    for(var w = 0; w &lt; width; w++)
    {
        var  but = document.createElement("li")
        but.appendChild(document.createTextNode("$" + stepWorth * (h + 1)))
        but.data("tile",{xPos:w, yPos:h, worth: stepWorth * (h + 1)})
        but.parent = spans[w]
        spans[w].appendChild(but)

        var sp = document.createElement("span")
        sp.appendChild(document.createTextNode( w + ',' + h))
        sp.parent = spans[w] 
        spans[w].appendChild(sp) 

    }
}
</code></pre>

<p>}</p>

<p>The user clicks load board and the board fills up. To find out which button was clicked I used a hidden span next to every button ( tag) but I feel like this is not a good solution. My problem is that I want to load my questions from an xml file so I need the index of the button on the board to load the correct question I can't load just any question. 
I wanted to do something object oriented but it's too damn strange with javascript. I have experience with .Net and this javascript is just too annoying please help me! </p>
