Yes maybe
Add the onchange event handler to your selection.
<select class="required" id="thechoices" onchange="return airportChoice(this)">
Set the display of the window identifier that you want to hide in order to hide.
Here is a generic function that returns an argument based on a link. Based on your question, so that you can easily have many options from the airport, simply add below each of your options if you need more options.
onchange="return airportChoice(this)"
Js function
function airportChoice(n){ if(n.selectedIndex === 1){ // show a div (id) // alert(n.value); document.getElementById(n.value).style.display = "block"; }else if(n.selectedIndex === 2){ location.href= n.value; // redirect the user to the url } // this last one is not what you ask but for completeness // hide the box div if the first option is selected again else if (n.selectedIndex == 0){ // alert(n[1].value); document.getElementById(n[1].value).style.display = "none"; } }
source share