what is the most efficient way to shorten this?
$('.img').click(function(e) {
if ($(this).attr('id') == 'myid') {
$('#a').hide();
$('#b').show();
} else {
$('#a').show();
$('#b').hide();
}
});
and does anything change to your answer if another option is added with an else if