Remove HREF attribute from any link with JQuery

You can remove any href that contains specific text inside the link. If you want to remove the link to any page that contains “DispForm” you can do it like this:

$('a[href*="DispForm"]').removeAttr("href");

‘*=’ means ‘Contains’, but you can use anything you need:

*= Contains
= Equal
!= Not equal
^= Starts With
$= Ends With

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.