This is what I came up to, with the first solution.
for(let i = 1; i <= 20; i++)
{
$(document).on("keyup change", ".email"+i, function() {
if ($(this).val().match(/@gmail./i)){
$("#groupa"+i).show();
$("#groupb"+i).hide();
} else {
$("#groupa"+i).hide();
$("#groupb"+i).show();
}
});
}
I’m going thank you guys for your answers, I’ve learned a lot the past days searching for questions, answers and reading you. And I will try your last solutions also, so I learn more.
I also want to say that sometimes one is so desperate for solutions, and dosen’t take time go outside take some air and read properly
I saw this in some javascript documents web when I started looking for what to do with content dynamically created.
$(document).on('keyup change', '#Id' , function() {
when phdr gave me his solution, i knew it was going to work since he already had answered some of my questions that lead to investigating and finding a solution.
But I already have seen the solution but was running all over the web not reading properly.
So much respect for everyone that is a part of this forum, I know it takes time to read, answer and come up with solutions. Sometimes one just goes to forums dumping questions, and doesn’t take the time to thank members helping disinterestedly, so thank you again.
.