更新时间:2023-12-01 10:27:22
Something along the line of :
$('a').on('click', function(){
var target = $(this).attr('rel');
$("#"+target).show().siblings("div").hide();
});
应该这样做。
PS :你的div必须放在容器中才能工作。
小提琴。
P.S: your divs have to be in a container for this to work. Fiddle.