How may I target certain links in list items using Javascript to remove certain characters? For example I have the following code:
<dd class="xments">
<ul>
<li><a href="#">"blah blah",</a></li>
<li><a href="#">"lo lo",</a></li>
<li><a href="#">"hhe he"</a></li>
</ul>
</dd>
I wish to remove the " and , for each list item. Please could some one help?
$("a").text(function(_, text) {
return text.replace('"', '');
return text.replace(',', '');
});
Doesn't seem to do it for me. How do I target only items in this list and not all a tags in the doc?