inputs = document.getElementsByTagName("input"); for (i = 0; i < inputs.length; i++){ if(inputs[i].type == 'text') inputs[i].value = ""; }