Link to home
Start Free TrialLog in
Avatar of boxhedge
boxhedge

asked on

Jquery remove html <a href=""> if href is empty

Hi all another simple one I guess I'm just not getting right.

I need jquery to search for any <a href  and if href is empty remove the html <a href=""> </a> but leave anything inside the tag be it text or img

so

<a href="">Text Content</a>
or
<a href=""><img src="img.jpg" /></a>

would become:
Text Content
or
<img src="img.jpg" />

regards
Lee
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial