您的位置:首页 > Web前端 > JQuery

jQuery---为链接添加链接图像

2008-10-15 20:53 253 查看
$(document).ready(function() {
$('#extlinks a').filter(function() {
return this.hostname && this.hostname !== location.hostname;
}).after(' <img src="external.png" alt="link">');
});
//this.hostname : 当前链接href的 www.**.com
//location.hostname : 地址栏的 www.**.com
本篇文章来源于 cssrain.cn 原文链接:http://www.cssrain.cn/article.asp?id=1115
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: