動作しません:JS jQueryのは.text()
$(".dpst_item").click(function(){
var dpst_id = this.id;
var text = $('img.'+dpst_id+' span.dpst_item_span').text();
alert(text);
}):
そして、このPHPコード:
echo '<div class="dpst_item_div"><img id="' . $item_classid . '" class="dpst_item" class="dpst_item-select" src="https://steamcommunity-a.akamaihd.net/economy/image/class/730/' . $item_classid . '/102fx102f" title="' . $item_name . '" ><span id="' . $item_classid . '_price" class="dpst_item_span" style="cursor:pointer">'.$item_price.'$</span></div>';
をしかし、私はaltertedで何かを得るいけません。
'.'と' classname' - > 'img。 '+ dpst_iを連結するスペースがありますd。あなたのコンソールを使ってデバッグしてください。 –
'.dpst_item'要素は' id'を持っていますか? Questionに 'html'を含めることができますか? – guest271314
はコードの残りの部分を追加しました – VeloFX