JSFiddle - React, Tailwind, and code Playground

by Per Ă…strand

HTML

<input type="checkbox" name="check0" value='1' onchange='setColor(this)' />
<input type="text" name="procedure0" value="1" />

<input type="checkbox" name="check1" value='2' onchange='setColor(this)' />
<input type="text" name="procedure1" value="2" />

<input type="checkbox" name="check2" value='3' onchange='setColor(this)' />
<input type="text" name="procedure2" value="3" />

JavaScript

function setColor(ele){
 	ele.nextSibling.nextSibling.style.backgroundColor = ele.checked ? "#6EDBFF" : "white";   
}