<table border="1" style="width:100%" id="table">
<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>
Top comments (0)