Now, when I try to use a function, when I put this as a parameter, it was not executed, but when I put OBJ, it worked normally. Can anyone tell me the difference between the two?
function mostraCampo(obj) {
var select = document.getElementById('instituição')
if (select.value == 'OUTRA') {
document.getElementById("outrainst").style.visibility = "visible";
} else{
document.getElementById("outrainst").style.visibility = "hidden";
}
}
<div class="form-group">
<label> Instituição de ensino <br />
<select class="form-group" name="instituição" id="instituição" onchange="mostraCampo(this.value);">
<option value="UFTM">UFTM</option>
<option value="UNIUBE">UNIUBE</option>
<option value="FACTHUS">FACTHUS</option>
<option value="SENAI">FAZU</option>
<option value="IMEPAC">IMEPAC</option>
<option value="NENHUMA">NENHUMA</option>
<option value="OUTRA">OUTRA</option>
</select>
<input type="text" class="form-control" name="outrainst" id="outrainst" style="visibility: hidden;">
</label>
</div>