I have a jsp page in which I add dynamically more textfields. The ids of those textfields are something like this: textfield1, textfield2, ..., textfieldn. I have a button which saves all of the values of the textfields. But first I want to check if some of the textfields have values in them. How can I check using JQuery all the textfields starting with 'textfield'?
$('[id^="textfield"]').each(function(index, item){
//do something with each one
})
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