Clear all TextBoxes using javascript.

Rajni.Shekhar
Posted by Rajni.Shekhar under JavaScript category on | Points: 40 | Views : 3719
function ClearAll() {
var objInput = document.getElementsByTagName("INPUT");
for (var iCount = 0; iCount < objInput.length; i++) {
if (objInput[iCount].type == "text")
objInput[iCount].value = "";
}
}

Comments or Responses

Posted by: T.Saravanan on: 4/9/2012 Level:Silver | Status: [Member] [MVP] | Points: 10
Hi,

Don't declare variable as 'i' in our DNF, because square brace of 'i' is consider as italic font format. kindly change your variable and post your code inside the code tag.

Login to post response