Ryan
Ryan

Reputation: 35

Removing instances of a particular tag that contains a specific attribute

I'm trying to use jQuery to remove all instances of <br type="_moz /> from within a page. I'm completely stuck as to how about accomplishing this.

Upvotes: 0

Views: 89

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039588

You could use an attribute equals selector to match the tags that you want to .remove():

$('br[type="_moz"]').remove();

Also fix your markup as it has a missing double quote for the type attribute:

<br type="_moz" />

Upvotes: 2

Related Questions