title: Am I using the following code to create a jquery slider, does the img change it but not the href?
body: <p>The slider only changes the path of src but not the link, where I have been wrong?</p>
  
  <pre><code>var imagenesSlider = $(".invisible &gt; a");
  var currentImg = 1;
  
  setInterval(function() {
          console.log(imagenesSlider[currentImg])
          console.log(currentImg)
          $("#slider a").attr("href", $(imagenesSlider[currentImg]).find("a").attr("href"));
          $("#slider img").attr("src", $(imagenesSlider[currentImg]).find("img").attr("src"));
          currentImg++;
          if (currentImg == imagenesSlider.length) {
              currentImg = 0;
          }
      }, 6000)
  </code></pre>