I made a code in Javascript that the person makes a consultation of the time of garbage collection by neighborhoods, but he asked me for a change, I wanted the person to select instead of writing, until I see okay, but I can not identify the error but is not looking, follow the code:
consultar = function() {
if (document.getElementById('ccidade').value == "patos") {
if (document.getElementById('cbairro').value == "abner") {
document.write("Segunda/Quarta/Sexta - 12:10 às 13:25 hs");
}
}
}
<form name="frm">
<select name="cidade" id="ccidade">
<option>Escolha uma cidade</option>
<option value="patos">Patos de Minas</option>
</select>
<select name="bairro" id="cbairro">
<option value="abner">Abner Afonso</option>
</select>
<input type="button" onclick="consultar()" />
</form>
I could not see the error in the code. Thanks in advance for your help.