I need to delete an element whose attribute cursor = "pointer".. I need do it with javascript in html
The item in question is this <g cursor="pointer"></g>.
I dont know the reason why the element has this form in html.
-
2@gdoron - tutorials.jenkov.com/svg/g-element.htmlbPratik– bPratik2012-11-25 20:12:03 +00:00Commented Nov 25, 2012 at 20:12
-
@bPratik. That's new, thanks.gdoron– gdoron2012-11-25 20:13:28 +00:00Commented Nov 25, 2012 at 20:13
Add a comment
|
1 Answer
You can use this:
$('g[cursor="pointer"]').remove();
4 Comments
Pointy
@gdoron I have a vague memory that not all browsers can "see" into SVG structures; it's as if they're not really part of the DOM. I could be completely wrong however.
gdoron
@Pointy, so, is there other ways?(if the vague memory didn't mislead you)
Pointy
I'm trying to determine whether I'm remembering correctly - I'll add a comment when I figure it out :-)
Pointy
I think I must be thinking of something else - this simple test suggests that it should work fine