How to select attribute (oblige) of the category that is set, Whenever I click the button !!
var btn = document.querySelector("#btn");
var categorias = document.querySelector("#categorias");
btn.addEventListener("click", selecObriga);
function selecObriga(e){
e.preventDefault();
}
<form>
<select id="categorias" name="categorias">
<option value="1" obriga="0">Cores</option>
<option value="2" obriga="1">Animais</option>
</select>
<input id="btn" type="submit">
</form>