I've got a button which I want to reset three form inputs.
I've managed to clear the two text inputs (input 1 and input 2) but the checkbox won't clear.
<button id="reset">reset</button>
Here is my script:
<script type="text/javascript">
document.getElementById('reset').onclick= function() {
var field= document.getElementById('textbox1');
field.value= field.defaultValue;
var field= document.getElementById('textbox2');
field.value= field.defaultValue;
var field= document.getElementById('agreecheckbox');
field.value= field.defaultValue;
};
</script>