JSFiddle - React, Tailwind, and code Playground
by Renilson Meneguci
HTML
<table class="table" border="1">
<thead>
<tr>
<td></td>
<th>CAMPO</th>
<th>INFORMAÇÃO ATUAL</th>
<th>INFORMAÇÃO CORRETA</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" class="cb" data-id="DtNascimento"></td>
<td> Data de Nascimento</td>
<td>11/11/1111</td>
<td><input type="text" data-id="DtNascimento" disabled class="form-control datapicker" name="DtNascimento" id="DtNascimento"></td>
</tr>
<tr>
<td><input type="checkbox" class="cb" data-id="DsEstadoCivil"></td>
<td> Estado Civil</td>
<td>Solteiro</td>
<td><input type="text" data-id="DsEstadoCivil" disabled class="form-control" name="DsEstadoCivil"></td>
</tr>
<tr>
<td><input type="checkbox" class="cb" data-id="DsOcorrencia"></td>
<td> Grau de Instrução</td>
<td>Segundo Grau Completo</td>
<td><input type="text" data-id="DsOcorrencia" disabled class="form-control" name="DsOcorrencia"></td>
...
JavaScript
var cbs = document.getElementsByClassName('cb');
function cbClick() {
var input = document.querySelector('input[data-id="' + this.getAttribute('data-id') + '"]:not([type="checkbox"])');
input.disabled = !this.checked;
$('table tr td(' + input + ')').css('background', '#e1e1e1');
}
for (var i in cbs) {
cbs[i].onclick = cbClick;
}