我有這種格式我如何用一個div包裹投入使用jQuery
<td class="value">
<input type="text" size="30" name="application[name]" id="application_name" data-validate="true" class="name">
</td>
,並與jQuery我需要最終的結果是這個
<td class="value">
<div class="field_with_errors">
<input type="text" size="30" name="application[name]" id="application_name" data-validate="true" class="name">
<label style="color: rgb(204, 0, 0);" class="message" for="application_name">Required</label>
</div>
</td>
正如你可以看到我有一個包裝div ....我不認爲我可以實現這與prepend。這裏是我的jQuery,到目前爲止,正如你可以看到我有輸入
var form = $(".applications_form");
var company_name = form.find(".name");
檢查http://api.jquery.com/wrap/ – 2012-03-06 16:09:35