Guys how can i remove an input with a specific value using jquery?
I know i should user .remove()
but i don't know how to find the specific input.
$("input[value='"+value+"']").remove();
Where value
is the value
of the element you want to delete. :)
Loop into the <input>
fields then match each values, if match, then remove it:
$(document).ready(function() {
$('input[type=text]').each(function() {
if ($(this).val() === "foo") {
$(this).remove();
}
});
});
Demo here jsFiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With