简体   繁体   English

用jquery按属性删除一个html元素

[英]remove a html element by attribute with jquery

I need to delete an element whose attribute cursor = "pointer". 我需要删除其属性cursor = "pointer".的元素cursor = "pointer". . I need do it with javascript in html The item in question is this <g cursor="pointer"></g> . 我需要使用html中的javascript进行处理。有问题的项目是<g cursor="pointer"></g> I dont know the reason why the element has this form in html. 我不知道为什么元素在html中具有这种形式的原因。

您可以使用此:

$('g[cursor="pointer"]').remove();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM