クリックしたリンクの前に配置された画像のsrcを取得しようとしています。
<ul id="grid">
<li><a href="prod-det.php" class="tip" rel="product-tip.php"><img src="../upload/mainmenu-articolo-ico.jpg" width="110" height="115"><p>GSE29KGYCSS / GSE29KGYCWW</p></a>
<div class="options">
<a href="#briciole" class="opt-compare off">Compare</a>
<a href="#briciole" class="opt-wish off">Wishlist</a>
</div></li>
そしてこのパスを書いてください:
$('.options a').click(function() {
$("#compare .myge-grid").append(closest('img').attr('src'));
しかし、私はimgsrcを取得できません。誰かが私を正しい方向に向けてくれませんか?事前にtks
編集:ここでより多くのコードhttp://jsfiddle.net/X2NBn/1/