I have this segment of code
$('#test').click(function(){
$(this).hide();
$('#hidethis').show();
});
$('#test2').click(function(){
$('#hidethis').hide();
$('#test').show();
})
This Code works fine, I'm however wanting to apply it to more elements. So i want to ideally add more ID's
I have tried this method which hasn't worked.
$('#test,#test3').each.click(function(){
$(this).hide();
$('#hidethis').show();
});
$('#test2,#test4').each.click(function(){
$('#hidethis').hide();
$('#test').show();
})
Will add a Fiddle if needed
.click. You should be getting an error on the console.