jQuery 如何删除所有 来自的标签?
我已经尝试过以下两种方法,但都不起作用:
$('#divhtml').remove('span')
$('#divhtml').find('span').remove()
编辑: $('#divhtml').find('span').remove()
有效第二次尝试。
I've tried both of the following but none of them worked:
$('#divhtml').remove('span')
$('#divhtml').find('span').remove()
EDIT: $('#divhtml').find('span').remove()
worked on 2nd try.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您已经使用了正确的说法:
这应该有效。请提供更多上下文...将此 jsfiddle 视为其他问题的“证明”:http://jsfiddle.net/Pbgqy/
You have already used a correct statement:
This should work. Please provide more context... See this jsfiddle as "proof" that something else is wrong: http://jsfiddle.net/Pbgqy/
试试这个:
Try this: