$(".userImg").each(function(){
    $(this).click(function(){
         var imgid = $(this).attr("id");
         alert(imgid );
    })
    });
//获取image src路径
$(".userImg").click(function(){
var imgsrc = $(this).attr("src");
alert(imgsrc);
});
//获取Id $("this")里面的 双引号“” 去掉
$(".userImg").click(function(){
var imageId= $(this).attr("id");
alert(imageId);
});

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
猜你喜欢
  • 2021-08-21
  • 2022-12-23
  • 2022-02-05
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案