私の位置からここで class="date" と id="z" のラベルを選択するにはどうすればよいですか?
<td style="width:300px;height:40px;" id="pricePanel">
<div id="class">
<label class="priceNumber" id="label">test</label>
<div class="no" hidden="hidden">
<input type="text" id='priceNumber' class="text" style="text-align:center;" onkeypress="if(event.keyCode==13)" value='@item.Cost.ToString()' />
</div>
<div>
</td>
<td id="x">
<label class="date" id="z">@date</label>
</td>
私の位置は、私のjQueryコードのテキストボックスブロックにあります:
$(".text").live("keypress", function (event) {
//Here I want to change the text of the label with class="date" and id="z"
});
注:メインコードにはループがあり、残念ながら同じクラスとIDのラベルがいくつかあります。このため、テキストを変更したテキストボックスの後にラベルを選択したいと考えています。