If you have a form just add a input with type reset
<input type="reset" value="Clear the Form" />
If you can't use this, then save the default values using .data
and retrieve them on you reset the form.
See this example on jsFiddle
$("#container :text").each(function() {
var $this = $(this);
$this.data("default", $this.val());
});
$("#container select option").each(function() {
var $this = $(this);
$this.data("default", $this.is(":selected"));
});
$("#container :button").click(function() {
$("#container :text").each(function() {
var $this = $(this);
$this.val($this.data("default"));
});
$("#container select option").each(function() {
var $this = $(this);
$this.attr("selected", $this.data("default"));
});
});
HTML
<div id="container">
<input type="text" value="default" />
<select>
<option>Op1</option>
<option selected="true">Op2</option>
</select>
<select multiple="true" size="5">
<option>Op1</option>
<option selected="true">Op2</option>
</select>
<input type="button" value="reset" />
</div>
To clear all inputs and remove all options on select
elements its more simple, see this example on jsFiddle (same html).
$("#container :button").click(function() {
$("#container :text").val("");
$("#container select").empty();
});