18 lines
348 B
Markdown
18 lines
348 B
Markdown
importance: 5
|
|
|
|
---
|
|
|
|
# Select all diagonal cells
|
|
|
|
Write the code to paint all diagonal table cells in red.
|
|
|
|
You'll need to get all diagonal `<td>` from the `<table>` and paint them using the code:
|
|
|
|
```js
|
|
// td should be the reference to the table cell
|
|
td.style.backgroundColor = 'red';
|
|
```
|
|
|
|
The result should be:
|
|
|
|
[iframe src="solution" height=180]
|