<script type="text/javascript">
$(function() {
$('.thelink a').select(function() {
var a_href = $(this).attr("href");
});
$('.calltoActionMoreInformation a').attr('href', a_href);
});
</script>
<div class="thelink" style="height: 250px; position: relative;">
<a title="xxx" href="xxx">
<img alt="tree" src="x" />
</a>
</div>
内部からhrefを入れようとしています:
<span class="calltoActionMoreInformation" style="position: absolute; bottom: 0px;">
<a title="" href="--Link here--"></a>
</span>
var a_href = 'http://www.google.co.uk'; を設定した場合 正しく設定されるため、問題は .thelink div. 内のリンクのみの href を取得することにあります。
.thelink a の href を .calltoActionMoreInformation a に割り当てるにはどうすればよいですか?