惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
V
V2EX
博客园 - 【当耐特】
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
量子位
MyScale Blog
MyScale Blog
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
月光博客
月光博客
I
InfoQ
WordPress大学
WordPress大学
Martin Fowler
Martin Fowler
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
小众软件
小众软件
罗磊的独立博客
Recent Announcements
Recent Announcements
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - iQingHan

C#中二进制和流之间的各种相互转换 underscore-1.8.3-analysis.js 经典JS 12 extremely useful hacks for JavaScript IIS字体文件添加MIME映射 js类型判断的方法 基于html5 canvas 的客户端异步上传图片的插件,支持客户端压缩图片尺寸 Google Chrome 默认非安全端口列表 js判断类型的方法 博客园样式排版自定义 easyloader.js源代码分析 JQuery操作cookies jQuery插件的开发 jQuery 1.9 移除了 $.browser 的替代方法 Pretty Gmail GreasemonkeyScript ASP.NET中关于验证控件和自定义弹出确认窗口的冲突问题 JQuery获取浏览器窗口的可视区域高度和宽度,滚动条高度 jQuery的选择器 园子里使用的jQuery.json
jQuery之移除链接小插件
iQingHan · 2012-08-15 · via 博客园 - iQingHan

分享自己写的一个小插件,不过需要的时候也有用。

/*
* jQuery小插件,移除链接
*/
(function ($) {
    $.fn.removeLink = function () {
        return this.each(function () {
            var text = $(this).html();
            $(this).after(text);
            $(this).remove();
        });
    }
})(jQuery);

使用方法如下:

$(function () {
    $("a").removeLink();
});

posted @ 2012-08-15 10:34  iQingHan  阅读(518)  评论(0)    收藏  举报