Hi i am trying to that a program that generate multiple click events with different ids depending on n-term. where n for now is 4,but it does not loop
here is my code
for (var i=1 ;i<= 4;i++){
$('#rl+i').click( function () {
$("#div"+i).fadeIn();
$("#outer").fadeOut();
});
}
my goal is to generate the below output if it is possible
$('#rl1').click( function () {
$("#div2").fadeIn();
$("#outer").fadeOut();
});
$('#rl2').click( function () {
$("#div2").fadeIn();
$("#outer").fadeOut();
});
$('#rl3').click( function () {
$("#div3").fadeIn();
$("#outer").fadeOut();
});
$('#rl4').click( function () {
$("#div4").fadeIn();
$("#outer").fadeOut();
});