use getElementsByTagName (the version of the class is not yet a cross-browser) and set the value to "" for elements with the required class.
var cname, elems = document.getElementsByTagName("input");
for ( var i = elems.length; i--; ) {
cname = elems[i].className;
if ( cname && cname.indexOf(CLId) > -1 ) {
elems[i].value = "";
}
}
(or you can use the reset input field for the whole form)
source
share