好的,我需要翻译这个结构。
<div class="field_with_errors">
<input id="count" name="count" size="2" type="text" />
<label class="message" for="count_for">Required</label>
</div>
如何去除外部的field_with_errors
和内部的消息,只保留输入标签?
如果我执行以下操作:
$("#count").closest(".field_with_errors").remove()
它会移除整个div
我可以先删除内部的.message
,但不确定如何删除外部的
$("#count").closest(".field_with_errors").find('.message').remove()
任何想法?