0

Possible Duplicate:
Remove hyperlink but keep text?

My question is fairly similar to this question: Remove hyperlink but keep text? but, I can't seem to workout how I can feed an array of class names and do this in one go?

For Example

Blah Blah Blah Blah

I would just like the links with the unwrap class to be modified.

Community
  • 1
  • 1
Keith Donegan
  • 26,213
  • 34
  • 94
  • 129

3 Answers3

2

Try this,

Live Demo

$('a.unwrap').contents().unwrap();
Adil
  • 146,340
  • 25
  • 209
  • 204
2

The selector a.unwrap specifies all a elements with class unwrap:

$('a.unwrap').contents().unwrap();

Example at JSFiddle.

Andomar
  • 232,371
  • 49
  • 380
  • 404
2

To do this on multiple classes, you can do

 $("a.className1, a.className2").contents().unwrap();
Prem
  • 5,844
  • 3
  • 25
  • 23