Zack
Zack

Reputation: 511

Removing all the span tags with a specific class from the entire webpage using Javascript

How do I remove every <span> tag with the class "button-label"

<span class="button-label"></span>

along with its content from the entire webpage using javascript.

Upvotes: 0

Views: 62

Answers (1)

Pawan B
Pawan B

Reputation: 4623

can you try this :

$('span.button-label').remove()

this might also work :

$( "span" ).remove( ".button-label" );

check the docs here

Upvotes: 3

Related Questions