This is my HTML code
<div class="anythingWindow">
<ul class="anythingSlider">
<li class="panel activePage">
<div class="content clearfix" style="width: 100%; height: 100%;">
<a href="http://www.example.com/a.jpg" class="focusedLink">
<img src= "http://www.example.com/a.jpg"/>
</a>
<div class="slider-text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit
<a title="" href="#">Read More</a>
</div>
</div>
</li>
<li class="panel activePage">
<div class="content clearfix" style="width: 100%; height: 100%;">
<a href="http://www.example.com/a.jpg" class="focusedLink">
<img src= "http://www.example.com/a.jpg"/>
</a>
<div class="slider-text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit
<a title="" href="#">Read More</a>
</div>
</div>
</li>
</ul>
</div>
As you can see in div.content > a > img there is image with specific location. How can I copy the URL from this image to the href attribute of div.slider-text > a?
I tried jQuery’s each() method, but couldn’t get it to work.
Try something like this;