I am trying to take the href attribute from an a tag, and apply that as the background-image of the anchor tag's child. For some reason it is not working.
I have the following html:
<div class="large-unit picture" itemscope itemtype="http://schema.org/ImageGallery">
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<a href="IMAGES/Gallery_PERSONAL/librarysession.jpg" itemprop="contentUrl" data-size="1500x2100" data-index="1" title="">
<div class="thumbnail" itemprop="thumbnail"></div>
</a>
</figure>
</div>
and the following javascript(using jquery):
$('figure').each( function() {
var thumb = $(this).find('.thumbnail');
var image = $(this).find('a').attr('href');
$(thumb).css('background-image', image);
});