Saturday, 19 August 2017

Select all anchors with a specific href with jquery

Here is the code for Select all anchors with a specific href with jquery:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
      <script>
      $(document).ready(function(){
        $("a").each(function(){
    if($(this).attr("href") == "http://example.com/external/link/")
    {
        $(this).hide();
    }
});
});
 </script>
  <a href="http://example.com/external/link/">a website link</a>

No comments:

Post a Comment

Google Map Filter Api Example

Here is Google Map Filter Api Example: