如何从我的位置选择具有class="date"和id="z"的标签?
注意:在主代码中,我有一个循环,不幸的是有一些带有相同类和id的标签,因此我想选择在我更改其文本的文本框之后的标签。
<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的标签,因此我想选择在我更改其文本的文本框之后的标签。