が、私はこのマークアップ(すべてunneccesary情報を削除)オブジェクトのtext()をDOMツリーの上に移動していますか? - jQueryの
<li>
<a></a>
<strong class="listingAmount">1</strong>
<strong class="listingPrice">10</strong>
<form class="marketListing">
<select>
</select>
<input />
</form>
</li>
を持っている私はjqueryの内選択ボックスのchange event
に.listingAmount
と.listingPrice
の値を取得しようとしています。私は.parent()
、.prev()
、.closest()
など多くの方法を試してみましたが、それを得ることはできません!
私のjqueryのは、これまでのところ、
$('.marketListing select').change(function() {
var price = $(this).parent().prev('.listingPrice').text();
var amount = $(this).parent().prev('listingAmount').text();
alert(price);
alert(amount);
});
にはどうすれselect
に、以前のある私が欲しいの値を得ることができますか?
おかげ
ありがとうございました! –