title: JQuery add class to a link
body: <p>My code is outputting a series of objects to the console, like:</p>
  
  <ul>
  <li>Object[a.mod-articles-category-title 362-o-que-e-o-bsc]</li>
  <li>Object[a.mod-articles-category-title curso-bs...e-gestao]</li>
  <li>Object[a.mod-articles-category-title curso-bs...processo]</li>
  </ul>
  
  <p>The code looks like the following:</p>
  
  <pre><code>var obj = &lt;?php echo json_encode($paginas); ?&gt;;
  
  $('a.mod-articles-category-title').each(function () {
      var links=$(this).attr('href');
  
      if(links.indexOf('/')!=-1){
          i=1;
      }
      else{
          i=0;
      }
  
      var procura=links.match(/(\d+)/g)[i];
  
      if(obj.indexOf(procura)!=-1){
          console.log($(this));
          $(this).addClass("visto");
  
      };
  
  });
  </code></pre>
  
  <p>Where obj is an array returned by a PHP function and procura is returning a number with a link id.</p>
  
  <p>If the number in procura is in the obj array, I want to add the class "visto", to give it a different style, but it isn't working...</p>