$(document).ready(function(){
$('#peoplelayer').click(function(){
$("#peoplelayer").each(function(){
$("#peoplelayer").fadeOut(500);
var str = $(this).text();
alert(str);
//$("#peoplelayer").fadeTo(500,0.6);
});
});
});
Run Code Online (Sandbox Code Playgroud)
这是代码,我对所有div使用相同的id"#peoplelayer",当我点击其中一个时,它会以相同的id警告这个div的所有文本
我怎么能防止这个问题,因为我需要提醒只有被点击的div,除了我需要给这个divs相同的id ???