I am using the following code to count the number of required input (textboxes) on an HTML5 form, which works fine.
var inputTags = document.getElementsByTagName('input');
reqinputCount = 0;
for (var i=0, length = inputTags.length; i<length; i++) {
if (inputTags[i].validity.valid == false ) {
reqinputCount++;
}
}
Now my problem is that I also have a textarea on the form and want to include that as well. Can you please help me out. Thanking in advance.
form.elementscollection, then just iterate over that.