undo
This commit is contained in:
parent
abb63bea7f
commit
6e28c4fd93
10
script.js
10
script.js
@ -48,8 +48,14 @@ function generateTable() {
|
|||||||
|
|
||||||
table.addEventListener('click', (ev) => {
|
table.addEventListener('click', (ev) => {
|
||||||
if (ev.target.tagName.toLowerCase() == "td" ) {
|
if (ev.target.tagName.toLowerCase() == "td" ) {
|
||||||
ev.target.style.borderColor = "green";
|
let cell = ev.target;
|
||||||
ev.target.style.backgroundColor = "green";
|
if (cell.style.borderColor == "green") {
|
||||||
|
cell.style.borderColor = "black";
|
||||||
|
cell.style.backgroundColor = "white";
|
||||||
|
} else {
|
||||||
|
cell.style.borderColor = "green";
|
||||||
|
cell.style.backgroundColor = "green";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user