Is there a better, more efficient way to write this code? It's a make shift drop down menu that allows user to RSVP for multiple people. Sorry, it's kind of a mess, but I think what I'm doing is clear. If not, I'm at my computer and will respond quickly with more info need be.
//There's got to be a better way to do this
$('#guest_num_1').click( function() {
$('#num_guests a#quant_guests').html("1")
$('.guest_name_2, .guest_name_3, .guest_name_4, .guest_name_5, .guest_name_6 ').hide()
});
$('#guest_num_2').click( function() {
$('#num_guests a#quant_guests').html("2")
$('.guest_name_2').fadeIn()
$('.guest_name_3, .guest_name_4, .guest_name_5, .guest_name_6').hide()
});
$('#guest_num_3').click( function() {
$('#num_guests a#quant_guests').html("3")
$('.guest_name_2, .guest_name_3').fadeIn()
$('.guest_name_4, .guest_name_5, .guest_name_6').hide()
});
$('#guest_num_4').click( function() {
$('#num_guests a#quant_guests').html("4")
$('.guest_name_2, .guest_name_3, .guest_name_4').fadeIn()
$('.guest_name_5, .guest_name_6').hide()
});
$('#guest_num_5').click( function() {
$('#num_guests a#quant_guests').html("5")
$('.guest_name_2, .guest_name_3, .guest_name_4, .guest_name_5').fadeIn()
$('.guest_name_6').hide()
});
$('#guest_num_6').click( function() {
$('#num_guests a#quant_guests').html("6")
$('.guest_name_2, .guest_name_3, .guest_name_4, .guest_name_5, .guest_name_6').fadeIn()
});