I have this code
This can be done by using this code:
document.getElementById('button').onclick = function() {
form.elements['c'].value = form.elements['c'].defaultValue;
}
But first make sure you give your element an ID of button, such as:
By using this code, you're basically saying any element with an attribute of c, within this form, to reset to the default value which it had.
See this jsFiddle.
This will work with your example code. However, it probably wont if you have multiple items that need resetting; this is where Javascript gets messy.
jQuery will be much simpler to use for multiple items which need resetting to default value.
Here's a simple way to set the value in jQuery:
$('input.reset').live('click', function() {
$('input.3').val('3');
});
Where as you need to define the value you want to have in this jQuery code, jQuery is very simple to understand. A
See this jsFiddle.