更新时间:2023-02-23 13:34:29
这将删除< a
和 / a>
:
mystr = "check this out <a href='http://www.google.com'>Click me</a>. cool, huh?";
alert(mystr.replace(/<a\b[^>]*>(.*?)<\/a>/i,""));
这不是真的万无一失,但也许它会为你的目的做到这一点......
It's not really foolproof, but maybe it'll do the trick for your purpose...