Skip to content

Instantly share code, notes, and snippets.

@tanelpuhu
Created March 5, 2010 20:50
Show Gist options
  • Save tanelpuhu/323134 to your computer and use it in GitHub Desktop.
Save tanelpuhu/323134 to your computer and use it in GitHub Desktop.
$(function(){
$('input.default').each(function(){
input = $(this);
input.data("val", input.val());
input.click(function(){
input = $(this);
if(input.val() == input.data("val")) {
input.val("");
input.removeClass("default");
}
});
});
$('input:text').addClass("text");
$('input:checkbox').addClass("checkbox");
$('input:radio').addClass("radio");
$('input:image').addClass("submit").addClass("image");
$('input:submit').addClass("submit");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment