开发者

jQuery remove specific fields

Hello I have this function that will delete all the empty fields in the form:

 $('input:text[value=""]', '#submForm').remove();

But as I said it will remove ALL the empty fields.

I need instead to check and remove only specific Fields with a Specific ID.

How do I change this function to remove only the the Fields I want and not every field in the form?

EDIT: Not specific Fields by using each ID of each Field开发者_如何学C. But all the Fields that are inside a Specific DIV id.

Thanks


Extend your selector like this:

$('div#someID input:text[value=""]', '#submForm').remove();

(assuming that the div is also a descendant of #submForm)


$("#divid").children().remove();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜