Get a reference to all text fields in JavaScript
Here is a little function that returns an array of all text fields in a document:
function getAllTextFields(){
var texts = [];
var inputs = document.getElementsByTagName(’input’);
for(var i=0; i <inputs.length; i++)
if(inputs[i].type == ‘text’)
texts.push(inputs[i]);
return texts;
}
