你好,我有很多带有“价格”类的文本框, 我想要做的就是用与第一个文本框相同的值来提供所有其他文本框。这是我的代码,但它不工作。根据第一个文本框的值jquery提供所有文本框
$firstprice=$("."+$sectionwrapper).find(".price").first().val();
$("."+$sectionwrapper).find(".price:eq(0)").nextAll(".price").val($firstprice);
我在哪里出错?任何帮助将不胜感激。
编辑
这是我的HTML代码
<div class="section-1">
<div id="bookin-ad-wrapper">
<div class="booking-wrapper booking-wrapper-5">
<ul>
<li><label class="w50">Pris kr</label><input type="text" value="" class="price numeric required" name="txtSection[1][5][price]" style=""></li>
</ul>
</div>
<div class="booking-wrapper booking-wrapper-6">
<ul>
<li><label class="w50">Pris kr</label><input type="text" value="" class="price numeric required" name="txtSection[1][6][price]"></li>
</ul>
</div>
<div class="booking-wrapper booking-wrapper-0">
<ul>
<li><label class="w50">Pris kr</label><input type="text" value="" class="price numeric required" name="txtSection[1][0][price]"></li>
</ul>
</div>
</div>
</div>
$ sectionwrapper表示类 “部分-1”
感谢
你能告诉我们HTML或作出小提琴? – Adil 2013-03-08 05:15:38
是的,只有在看到HTML后我们才能说。 – 2013-03-08 05:15:50
@Adil,我已更新问题 – WatsMyName 2013-03-08 05:21:53