1.1 | 2.1 | 3.1 | 4.1 | 5.1 |
1.2 | 2.2 | 3.2 | 4.2 | 5.2 |
1.3 | 2.3 | 3.3 | 4.3 | 5.3 |
1.4 | 2.4 | 3.4 | 4.4 | 5.4 |
1.5 | 2.5 | 3.5 | 4.5 | 5.5 |
<br>
let tableEl = document.getElementById("table");<br>
let tableRows = document.querySelectorAll("table tr");</p>
<div class="highlight"><pre class="highlight plaintext"><code>let ind=0;
while(tableRows[ind]){
tableRows[ind].cells[ind].style.backgroundColor = "red";
ind++;
}
</script>
</code></pre></div>
<p></body></p>
Top comments (0)