Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
11
rated 0 times [  13] [ 2]  / answers: 1 / hits: 11715  / 10 Years ago, thu, may 1, 2014, 12:00:00

I have a <div id=inputform> and in that div there are multiple <input type=text> .
How can I count the number of <input> fields?


More From » html

 Answers
5
var inputFormDiv = document.getElementById('inputForm');
alert(inputFormDiv.getElementsByTagName('input').length);

[#45625] Wednesday, April 30, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarettajb

Total Points: 678
Total Questions: 94
Total Answers: 90

Location: Guernsey
Member since Tue, Jul 6, 2021
3 Years ago
;