Im triying to do a combo where the when the user selects Chile out of the select box, a second select shows up showing the cities. The jQuery code Im using is this.
$(document).ready(function() {
var ciudad = $("#ciudad");
ciudad.css("display","none");
$("select#selectionpais").change(function() {
var hearValue = $("select#selectionpais").val();
if( hearValue == "chile") {
ciudad.css("display","block");
} else {
ciudad.css("display","none");
}
});
});
and the Html is this (abreviated for the sake of understanding)
<select name="pais" id="selectionpais">
.... Chile Afganistán
and the second select (the one that should be shown is this)
<select id="ciudad" name="ciudad" class="ciudad">
Santiago
Anyone has a clue why it isnt working?