Return to Snippet

Revision: 48017
at June 22, 2011 01:33 by cdurocher

Initial Code
<script type="text/javascript">
	$(document).ready(function() {
		swapValue = [];
		 swapValue[i] = $(this).val();
		   if ($(this).val() == swapValue[i]) {
		   if ($.trim($(this).val()) == "") {

Initial URL

Initial Description
Specifiy a default value to input text field. OnFocus, the default value clear and let you type a new value. If typed value is erased then the default value is set back.

Initial Title
jQuery: Input text default value, clear value on click, if typed value erased, get default value back

Initial Tags
form, jquery

Initial Language