Javascript matrix
<p>Given a 3 x 3 randomized matrix filled with the numbers 1-9, i need to write code so that the user can click on a cell (it turns from white to orange) and then click on another cell so that the two numbers insides the cells switch and the orange cell turns back to white. this needs to continue until the user arranges the 9 numbers in order. so far this is what i have:</p>

<pre><code>function processclick(tileId){
if(clickedcell==""){
    var  firstcell = document.getElementById(tileId);
    clickedcell = document.getElementById(tileId).innerHTML;
    document.getElementById(tileId).style.backgroundColor = "#D35400";
}
else{
    firstcell.element.innerHTML = document.getElementById(tileId).innerHTML;
    document.getElementById(tileId).innerHTML = clickedcell;
    firstcell.style.backgroundColor = "#FFFFFF";
    clickedcell = "";
}
</code></pre>

<p>For some reason, the firstcell is not changing numbers with the second cell and not changing colors. Any help would be appreciated.</p>