如何從我的位置選擇class =「date」和id =「z」的標籤?如何選擇jQuery中的下一個標籤?
<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"
});
注:在主代碼中,我有一個循環,不幸的是有一些標籤具有相同class和id正因爲如此,我想在改變文本的文本框之後選擇標籤。
在主代碼中,我有一個循環,不幸的是,有一些標籤具有相同的類和標識,因此我希望在更改文本的文本框之後選擇標籤。 – 2013-03-12 05:23:29