Changing the link address with jQuery

Another small script with which you can replace the link path with a specific class (yes, yes, there are perverted situations when it is long and dreary to do this or fix it in the source code of the modules).

<script>
    jQuery(document).ready(function($) {        
        $('a.sf-depth-1[href="/"]').prop('href', '#');    
    });
</script>

In this case, instead of the final url href = "/", we get href = "#". In the code above, you can replace the sharp with any character or address that you need to render in the link.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
The comment language code.