outerHTML兼容方法(jquery)

1 //outerHTML方法
2     $.fn.outerHTML = function(){
3         var $t = $(this);
4         return ("outerHTML" in $t[0]) ? $t[0].outerHTML : $t.clone().wrap('<p>').parent().html();
5     }

 

posted @ 2013-01-25 10:49  无嗔  阅读(481)  评论(0编辑  收藏  举报