With a more restrictive regexp this is ok. A more efficient way would be to do `doc.getElementsByName('bib_rid')` and then check for `element.tagName == 'INPUT'` in the while loop if you feel that is necessary.