JSFiddle - React, Tailwind, and code Playground
HTML
<select id="select" onchange="Verifica()">
<option>
---
</option>
<option>
AM
</option>
<option onclick="PM()">
PM
</option>
</select>
<select id="AM">
<optio>12:00</option>
<option>01:00</option>
</select>
<select id="PM">
<option>22:00</option>
<option>23:00</option>
</select>
<script>
function Verifica(){
var verifica = document.getElementById("select").value;
if (verifica == 'AM') {
document.getElementById("PM").style.display = "none";
document.getElementById("AM").style.display = "block";
}
else if (verifica == 'PM'){
document.getElementById("AM").style.display = "none";
document.getElementById("PM").style.display = "block";
}
else {
alert("sla");
}
}
</script>
CSS
#AM {
display: none;
}
#PM {
display: none;
}