Let’s take the case type="text" as an example:
By calling the Refresh method of js
Method 1
function Refresh()
{
var v=document .forms[0].elements;
for(var i=0;i{
if(v[i].type=="text")
{
v[i].value="";
}
}
}
or method two
function Refresh()
{
var v=document.getElementsByTagName("input" );
for(var i=0;i{
if(v[i].type=="text")
{
v[ i].value="";
}
}
}
Clear the value of an element by calling the refresh function