Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
muktar1907 committed Apr 24, 2024
1 parent 1742189 commit e598c6a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ <h1>The Word Search Game</h1>
//create cells and add it to the row
const cell = document.createElement("td");
cell.setAttribute("id",k.toString());

cell.addEventListener("click",buttonEvent(k.toString(),0));

const cellText=document.createTextNode(`${k}`);
cell.appendChild(cellText);
Expand All @@ -210,20 +210,20 @@ <h1>The Word Search Game</h1>
document.body.appendChild(tbl);
tbl.setAttribute("border","1.5");

var cells = document.querySelectorAll("td");

}
var cells = document.querySelectorAll("td");
for(var i=0;i<cells.length;i++)
{
cells[i].addEventListener("click",buttonEvent(cells[i].getAttribute("id"),0));
cells[i].addEventListener("mouseover",buttonEvent(cells[i].getAttribute("id"),1));
//cells[i]
//cells[i].addEventListener("mouseover",buttonEvent(cells[i].getAttribute("id"),1));
}
}

function buttonEvent(cell,action)
{
const button= document.getElementById(cell.toString());
button.style.backgroundColor="blue";
U = new UserEvent();
U.cell=cell;
U.cell=parseInt(cell);
U.action=action;
U.player=player;
U.gameId=gameId;
Expand Down

0 comments on commit e598c6a

Please sign in to comment.