如何从我的位置选择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