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) => {
|
||||
if (ev.target.tagName.toLowerCase() == "td" ) {
|
||||
ev.target.style.borderColor = "green";
|
||||
ev.target.style.backgroundColor = "green";
|
||||
let cell = ev.target;
|
||||
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