开发者

Jquery dynamic link removal

Consider the following

var newLink = $('<a/>'开发者_如何转开发).attr('href', name);
previewImage.wrap(newLink);

It outputs

<a href><img src=" "/></a>

I need some Jquery code to modify this to: <img src=" "/> (Only remove the wrapping link without the img). Any help will be greatly appreciated.


Use unwrap:

theImage.unwrap();

E.g.:

newLink.find("img").unwrap();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜