I need remove a[href] from the following html:
<span class="fl-post-info-author">
<a href="/author/name/“>Author Name</a>
</span>
$('span.fl-post-info-author a').removeAttr("href");
I've tried this but am not sure how to target the href. I'm trying to disable the link entirely, and want the text to stay, just not be a link. It's a post meta link in WordPress.
Make sure your jQuery code is executed only when the document enters the ready
state by wrapping it in a $(document).ready()
function block:
$(document).ready(function() {
$('span.fl-post-info-author a').removeAttr("href");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span class="fl-post-info-author">
<a href="/author/name/">Author Name</a>
</span>