function Car (pMake, pModel, pColor){
this.make = pMake
this.model = pModel
this.color = pColor
}
Car.prototype.showCar = function {
alert(this.make + ” ” + this.model + ” ” + this.color);
}
Function to reset form values.
function resetForm(theForm){
for(i=0; i<theForm.elements.length; i++)
{
if(theForm.elements[i].type == "text")
{
theForm.elements[i].value = '';
}
else if(theForm.elements[i].type == "select-one")
{
theForm.elements[i].selectedIndex = 0;
}
}
}
other possible form elements: textarea, checkbox