I’d like to make this better/simpler, so further functions can be added later?
$(function() {
$('#boroughs').change(function() {
$('.boroughs').hide();
$('.fitness').hide();
$('#' + $(this).val()).show();
});
});
$(function() {
$('#b1').change(function() {
$('.fitness').hide();
$('#' + $(this).val()).show();
});
});
$(function() {
$('#b2').change(function() {
$('.fitness').hide();
$('#' + $(this).val()).show();
});
});
1 Answer