Say I have this mockup-code:
button.click(function(){generateForm();}
function generateForm(){
div.append(<input type='text' id='x'>);
}
I will need the ID in order to access the element individually.
What is the best way to avoid having ID-conflicts in a scenario like this ?
Its better to use
classinstead. But if you are still willing to useid, you may consider using a counter like this: