<div> <input type="text" name="a"/> <input type="text" name="b"/> <input type="text" name="length"/> </div>
var inp = document.getElementsByTagName("input"); alert(typeof inp.length);