I have a randomized set of input elements that appear when users select different options on a form. I want to find all the input boxes within a certain div by their classname and then call a function that sets those items to an array of objects. So far I have this:
$('.div-class-name').find('input.input-class-name:textbox')
I'm not sure where to go from here. I know what needs to go into the function once it is called but I don't know how to call it. How do I call a function after a find for all the returned elements?
Thank you in advance.
$('.div-class-name').find('input.input-class-name').each(function(el) {
//this will run for each matching input
console.log($(this)); //$(this) is a jquery reference to the element in the list of matching ones
});
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