The code below will go through an html document, receive all forms and display a pop-up warning about the names of each form.
var formsCollection = document.getElementsByTagName("form");
for(var i=0;i<formsCollection.length;i++)
{
alert(formsCollection[i].name);
}
This is only the beginning if you want to get the desired result. After that, remove the warning and continue to do what you need.
source
share