jquery.more.js如何把数据库里的路径遍历到img标签里,依次显示图片?

JavaScript012

jquery.more.js如何把数据库里的路径遍历到img标签里,依次显示图片?,第1张

$("img").each(function(){

$(this).attr("src","newsrcValue")//修改图片路径

$(this).parent("a").attr("href","newhrefValue")//修改链接路径

})

$(".imgCla").each(function(i,e){

    alert($(e).attr("src"))

})

你的页面存在问题,img 标签的ID一样。

我看你的代码里面只有img标签使用imgCla

所以选择获取所有 class="imgCla"的标签