For some reason, some of the selections work but most don't. I can't figure out what I am doing wrong, maybe you can help? Here is a live demo on codepen: http://codepen.io/AlexBezuska/pen/dHmge My jQuery:
$('#ddlOffice option').hide();
$('#ddlBusiness').change(function(){
var selectedBusiness = $( "#ddlBusiness option:selected").val();
selectedBusiness = parseFloat(selectedBusiness);
$('#ddlOffice option').hide();
$('#ddlOffice option[value="'+selectedBusiness+'"]').show();
$('#txtBusiness').val($( "#ddlBusiness option:selected").text());
});
$('#ddlOffice').change(function(){
$('#txtOffice').val($( "#ddlOffice option:selected").text());
});
Bonus points: I would like to do this without jQuery, if anyone has tips on an easy way of doing the showing and hiding in raw javascript or wants to do a fork without jQuery would be awesome,
Thanks!