<html>
<body>
<div class="top">
<a class="zzz" href="http://www.abc.com/1.html">aaaa</a>
<a class="xxx" href="http://www.abc.com/2.html">bbbb</a>
<a class="ccc" href="http://www.abc.com/3.html">cccc</a>
</div>
<div class="content">
<a class="ppp" href="http://www.abc.com/4.html">dddd</a>
<a class="mmm" href="http://www.abc.com/5.html">eeee</a>
<a class="kkk" href="http://www.abc.com/6.html">ffff</a>
</div>
<div class="qw-list">
<a class="ft-item" href="http://www.abc.com/7.html">gggg</a>
<a class="ft-item" href="http://www.abc.com/8.html">hhhh</a>
<a class="ft-item" href="http://www.abc.com/9.html">iiii</a>
</div>
</body>
</html>
要求说明:链接中的主域名abc.com是统一的,要求按照主域名是abc.com,并且类class="ft-item"一样的所有标签中的href网站替换为http://www.opq.com,其他不同类名的a标签href链接不变。最好是用js实现,或者是php。
$('.ft-item').each(function(){
$(this).attr('href','http://www.opq.com/'+$(this).attr('href').split('/').pop());
})
如果没有其他特殊情况