Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
reset the default value for input fields
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
javascripts
LICENSE
README.md
demo.html

README.md

jquery.inputReset

This plugin allows you to reset the default value for an input field. This is useful if you have form fields that your users would like to be able to reset.

Usage

When your dom is ready, mark the input fields you would like to be resettable.

$(function() {
  // this will remember the default value for #my-input-field
  $('#my-input-field').setDefaultText();
});

Elsewhere on your page, you can call 'resetDefaultText' to restore the original value.

<!-- clicking this will reset the field back to it's original value -->
<a onclick="$('#my-input-field).resetDefaultText()">Reset</a>

Example

See demo.html

Something went wrong with that request. Please try again.