Hello. I need your help, when I click on the link:
<a id="f1" href="#">Текст</a> It is necessary to take all the elements that I indicated below, hide them and show the element with id = "f11".
I managed to do it, but I need to optimize the code, I used the logical operator AND (&&), but since I just started to learn JQuery, the optimized version does not work for me.
Here is the old code that works:
$('#f1').click(function(){ $('#f9').hide(0,function() { $('#f22').hide(0,function() { $('#f33').hide(0,function() { $('#f44').hide(0,function() { $('#f55').hide(0,function() { $('#f66').hide(0,function() { $('#f77').hide(0,function() { $('#f88').hide(0,function() { $('#f11').show(0); }); }); }); }); }); }); }); }); }); And this is the new "optimized" code that does not work:
$('#f1').click(function(){ $('#f9'&&'#f22'&&'f33'&&'f44'&&'f55'&&'f66'&&'f77'&&'f88').hide(0,function() { $('#f11').show(0); }); }); And one more thing, my code is executed when I click on the link with id = "f1", but I need it when I press id = "f1" or id = "f111".
Thank you in advance!
$('#f9, #f22, #f33, #f44, ...')- Igor$('#f1, #f111').click- Igor