You can use document.querySelectorAll('form')
. This will return you list of all the forms. Now you can get data of any form just using index
on this node list like
var froms = document.querySelectorAll('form');
var f1Data = new FormData(forms[1]); //To get the data of first form
var f2Data = new FormData(forms[2]);
....
Or you can also add data-attribute
to each form and select the required form with that
Something like
<form data-form="form-1">...</form>
<form data-form="form-2">...</form>
<form data-form="form-3">...</form>
Now you can use document.querySelector('form[data-form="form-1"]');
to get the first form and so on