JSFiddle - React, Tailwind, and code Playground

by madBYK

HTML

<table id="t">   
   <tr><td id="t1">one</td></tr>   
   <tr><td id="t2">two</td></tr>   
</table>

CSS

#t { border: 1px solid red }  
#t1 { background-color: pink; }

JavaScript

// Function to change the content of t2  
function modifyText() {  
 var t2 = document.getElementById("t2");  
 t2.firstChild.nodeValue = "three";      
}  

// add event listener to t  
var el = document.getElementById("t");   
el.addEventListener("click", modifyText, false);