I would like when the person chooses one of the options of the select to appear the form as the code says. And also that when one form appeared the other would have display none.
$(document).ready(function() {
document.getElementById('test').addEventListener('change', function () {
if (this.value == 2) {
var style = this.value == 2 ? 'block' : 'none';
document.getElementById('formContato').style.display = style;
}; else if (this.value == 3) {
var style = this.value == 3 ? 'block' : 'none'
document.getElementById('formRevenda').style.display = style;
}; else (this.value == 4){
var style = this.value == 4 ? 'block' : 'none';
document.getElementById('formCliente').style.display = style;
};
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divclass="assunto c-form">
<label class="lado">
<select class="text" id="test">
<option id="trabalhe" value="1">Trabalhe conosco</option>
<option id="sugestoes" value="2">Sugestões/Reclamações</option>
<option id="revendas" value="3">Cadastro de Revendas</option>
<option id="clientes" value="4">Cadastro de clientes</option>
</select>
</label>
</div>
<form id="formContato" style="display: none;">
<input type="text">
</form>
<form id="formRevenda" style="display: none;">
<input type="text">
</form>
<form id="formCliente" style="display: none;">
<input type="text">
</form>