jQuery之移除链接小插件

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

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

使用方法如下:

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

 

 

 

 

 

posted @   iQingHan  阅读(504)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示