Right. This last issue is the toughest. There are a couple ways to try to tackle it:
First: Try to edit the html currently stored in boardMemory,
Second: Scrap boardMemory in lieu of another method of displaying the selected numbers.
I would really recommend the second method, as we can really eliminate the need to replace the entire cell’s contents.
Here’s what I suggest:
Currently, your cells look like this:
<div id="numberContainer111">
<div class="number" id="div1111"><a onclick="puzzleAction(1,1,1,1,'hide');" oncontextmenu="showHideNumber('lnk1111',1);" href="#" id="lnk1111">1</a></div>
<div class="number" id="div1112"><a onclick="puzzleAction(1,1,1,2,'hide');" oncontextmenu="showHideNumber('lnk1112',2);" href="#" id="lnk1112">2</a></div>
<div class="number" id="div1113"><a onclick="puzzleAction(1,1,1,3,'hide');" oncontextmenu="showHideNumber('lnk1113',3);" href="#" id="lnk1113">3</a></div>
<div class="number" id="div1114"><a onclick="puzzleAction(1,1,1,4,'hide');" oncontextmenu="showHideNumber('lnk1114',4);" href="#" id="lnk1114">4</a></div>
<div class="number" id="div1115"><a onclick="puzzleAction(1,1,1,5,'hide');" oncontextmenu="showHideNumber('lnk1115',5);" href="#" id="lnk1115">5</a></div>
<div class="number" id="div1116"><a onclick="puzzleAction(1,1,1,6,'hide');" oncontextmenu="showHideNumber('lnk1116',6);" href="#" id="lnk1116">6</a></div>
<div class="number" id="div1117"><a onclick="puzzleAction(1,1,1,7,'hide');" oncontextmenu="showHideNumber('lnk1117',7);" href="#" id="lnk1117">7</a></div>
<div class="number" id="div1118"><a onclick="puzzleAction(1,1,1,8,'hide');" oncontextmenu="showHideNumber('lnk1118',8);" href="#" id="lnk1118">8</a></div>
<div class="number" id="div1119"><a onclick="puzzleAction(1,1,1,9,'hide');" oncontextmenu="showHideNumber('lnk1119',9);" href="#" id="lnk1119">9</a></div>
</div>
What you could do is modify them to look like this:
<div id="numberContainer111">
<div class="number" id="div1111"><a onclick="puzzleAction(1,1,1,1,'hide');" oncontextmenu="showHideNumber('lnk1111',1);" href="#" id="lnk1111">1</a></div>
<div class="number" id="div1112"><a onclick="puzzleAction(1,1,1,2,'hide');" oncontextmenu="showHideNumber('lnk1112',2);" href="#" id="lnk1112">2</a></div>
<div class="number" id="div1113"><a onclick="puzzleAction(1,1,1,3,'hide');" oncontextmenu="showHideNumber('lnk1113',3);" href="#" id="lnk1113">3</a></div>
<div class="number" id="div1114"><a onclick="puzzleAction(1,1,1,4,'hide');" oncontextmenu="showHideNumber('lnk1114',4);" href="#" id="lnk1114">4</a></div>
<div class="number" id="div1115"><a onclick="puzzleAction(1,1,1,5,'hide');" oncontextmenu="showHideNumber('lnk1115',5);" href="#" id="lnk1115">5</a></div>
<div class="number" id="div1116"><a onclick="puzzleAction(1,1,1,6,'hide');" oncontextmenu="showHideNumber('lnk1116',6);" href="#" id="lnk1116">6</a></div>
<div class="number" id="div1117"><a onclick="puzzleAction(1,1,1,7,'hide');" oncontextmenu="showHideNumber('lnk1117',7);" href="#" id="lnk1117">7</a></div>
<div class="number" id="div1118"><a onclick="puzzleAction(1,1,1,8,'hide');" oncontextmenu="showHideNumber('lnk1118',8);" href="#" id="lnk1118">8</a></div>
<div class="number" id="div1119"><a onclick="puzzleAction(1,1,1,9,'hide');" oncontextmenu="showHideNumber('lnk1119',9);" href="#" id="lnk1119">9</a></div>
<div class="selectedNumber"></div>
</div>
When a number is clicked, get the anchor’s number and fill the selectedNumber with the same contents you’re currently injecting into the cell.
Make selectedNumber take 100% height and width of its cell, and give it a z-index of 2, and a white background.
That way it will cover up the numbers in its cell, but they will still be there and the javascript will still be able to act upon them when the selectedNumber is deselected.