Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从jQuery对象中删除链接_Jquery_Html - Fatal编程技术网

从jQuery对象中删除链接

从jQuery对象中删除链接,jquery,html,Jquery,Html,我有一个关于jQuery的问题,我想从存储 $website.html().remove('a'); $website.html() returns = egg street eggland eg1 <a href="random"> <img src=""></img>

我有一个关于jQuery的问题,我想从存储

 $website.html().remove('a');

 $website.html() returns = egg street eggland eg1 <a href="random">
                                                       <img src=""></img>
                                                  </a>
但这似乎并没有消除任何东西

如果我完全做错了,你能给我指出正确的方向吗

谢谢

基本上用ing
$website
查找所有锚定标记并将其删除


相反(根据OP下面的评论):
基本上,在
$website
中查找所有锚定标记的内容并将其删除。

@jondavidjohn:-p您知道您喜欢它^ ^或者,
$website.find('a').remove(),这就是上下文选择器在幕后运行的方式。有没有一种方法可以做相反的事情并返回不在alink内的内容?你说“返回不在alink内的内容”是什么意思?@sausageRolls-um他在问问题,而不是发表声明。查看我的更新。。。。
$website.remove('a');
$('a', $website).remove(); // P00F
$($website.children()).not('a').remove(); // P00F