开发者

jQuery remove specific fields

开发者 https://www.devze.com 2023-03-22 00:22 出处:网络
Hello I have this function that will delete all the empty fields in the form: $(\'input:text[value=\"\"]\', \'#submForm\').remove();

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

精彩评论

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