<div id="pic"><img src="/images/newimages/" width="120" height="90" alt="" /></div>
<div id="pic"><img src="/images/newimages/1.jpg" width="120" height="90" alt="" /></div>
我想只改变第一个<img src="images/newimages/" width="120" height="90" alt="" />为<img src="images/newimages/noimage.jpg" width="120" height="90" alt="" />,第二个<img src="/images/newimages/1.jpg" width="120" height="90" alt="" />不改变。感谢各位大侠指导帮助写一下。
网站里有这种情况,html页面发现就替换为其他路径正常的不用替换,怎么写呢?大侠再指导一下
追答$("img[src='/images/newimages/']").attr ("src", "images/newimages/noimage.jpg");
怎么你的需求变来变去的
我想只改变第一个为,第二个不改变
死脑残提问者,提这个问,还来追问我,结果却采纳别人,卑鄙无耻,自己脑残害别人
这个该死的提问者死J8,越想越气愤,真想一J8甩死你。。。
试试
$("img[src='/images/newimages/']").attr('src','/images/newimages/noimage.jpg');本回答被提问者采纳