JSFiddle - React, Tailwind, and code Playground
HTML
<select id="area" name="area">
<option value="">Selecione</option>
<option value="Informática">Informática</option>
<option value="RH">RH</option>
</select>
<select id="setor" name="setor">
</select>
JavaScript
$(function(){
var setores = {
"Informática": ["Sistemas", "Suporte", "Redes"],
"RH": ["Folha de pagamento", "Benefícios", "Contratações"]
};
$("#area").on('change', function(){
var options = $("#setor");
options.find('option').remove();
if($(this).val() == "") return;
$.each(setores[$(this).val()], function() {
options.append
($("<option />").val(this).text(this)
);
});
});
});