This is my HTML Select box. When I choose Option Filter by Country then FIlter by Country Select box should appear and all of the state and local address select box should hide and when I select to filter by state then state select box should be appear and other should hide
<select id="filter by address">
<option value="none">All</option>
<option value="0">Filter by Country</option>
<option value="1">Filter by State</option>
<option value="2">Filter by Local Address</option>
</select>
<select id="local_address">
<option>Select By Local Address</option>
</select>
<select id="country">
<option>Select By Country</option>
</select>
<select id="state">
<option>Select By State</option>
</select>
This is the Script file and When choose to filter by country then a country select box appears and another select box will hide but other state and local address option value does not become null
$('#filter by address').change(function () {
var address=$(this).val();
if(address==1){
$("#state").css("display","block");
$("#country").css("display","none");
$("#local_address").css("display","none");
$('#local_address').val(null); //I want to set them null if state is chooses
$('#country').val(null); //I want to set them null if state is chooses
}else if (address==2){
$("#local_address").css("display","block");
$("#country").css("display","none");
$("#state").css("display","none");
$('#country').val(null); //I want to set them null if local_address is chooses
$('#state"').val(null); //I want to set them null if local_address is chooses
}else if (address==0){
$("#country").css("display","block");
$("#state").css("display","none");
$("#local_address").css("display","none");
$('#state').val(null); //I want to set them null if country is chooses
$('#local_address').val(null); //I want to set them null if country is chooses
}else if(address=="none"){
$("#country").css("display","none");
$("#local_address").css("display","none");
$("#state").css("display","none");
$('#state').val(null); //I want to set them null if none is chooses
$('#local_address').val(null); //I want to set them null if none is chooses
$('#country').val(null); //I want to set them null if none is chooses
}
})
So my problem is how to set null other select box option ?