Using jquery, i would like to remove a hidden input, based on a class name selector but I just want to remove this inside of one specific form?
something like this:
$('.addToCartButton').click(function () {
var form = $(this).closest('form');
//remove all inputs with class name "test" inside of the form object above.
});
What is the best way of doing this?
Update
As a follow up question, how can i
1. First read each input val() into a variable before i remove it?
2. Get the first element from the find method (as it could return multiple elements)?
this should do it
http://api.jquery.com/remove/
follow up:
loop through all values in array