2

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

1 Answer 1

6

You can use this:

$('g[cursor="pointer"]').remove();
Sign up to request clarification or add additional context in comments.

4 Comments

@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.
@Pointy, so, is there other ways?(if the vague memory didn't mislead you)
I'm trying to determine whether I'm remembering correctly - I'll add a comment when I figure it out :-)
I think I must be thinking of something else - this simple test suggests that it should work fine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.