I want to clean ALL the fields of the form that are of type "text", it works correctly for me but in the console I get the following error:
formulario.js:175 Uncaught TypeError: Cannot read property 'type' of undefined
Code:
function limpiar(){
var cajas_texto = document.getElementsByTagName("input");
for(var i=0; cajas_texto.length; i++)
if(cajas_texto[i].type == "text")
cajas_texto[i].value="";
}