JSFiddle - React, Tailwind, and code Playground
HTML
<div id="botoes">
<button data-for="cod" onclick="checkbox(this)">cod</button>
<button data-for="nome" onclick="checkbox(this)">nome</button>
<button data-for="barras" onclick="checkbox(this)">barras</button>
<button data-for="desc" onclick="checkbox(this)">desc.</button>
</div>
JavaScript
function checkbox(btn) {
var idParent = btn.parentElement.id || child.parentNode.id;
alert(idParent);
}