Write a JS function that changes the color of all even rows when the user clicks a button. Apply the color "Teal" to the target rows.
Input/Output:
There will be no input/output, your program should instead modify the DOM of the given HTML document.
Sample HTML:
<table>
<tr><th>Name</th><th>Town</th></tr>
<tr><td>Eve</td><td>Sofia</td></tr>
<tr><td>Nick</td><td>Varna</td></tr>
<tr><td>Didi</td><td>Ruse</td></tr>
<tr><td>Tedy</td><td>Varna</td></tr>
</table>
<button onclick="colorize()">Colorize</button>
<script>
function colorize() {
// TODO
}
</script>
Examples:
