Skip to content

Instantly share code, notes, and snippets.

@williankeller
Created June 26, 2015 14:24
Show Gist options
  • Select an option

  • Save williankeller/65a5de405d122bb9ce2d to your computer and use it in GitHub Desktop.

Select an option

Save williankeller/65a5de405d122bb9ce2d to your computer and use it in GitHub Desktop.
var toggleInputPlaceholder = function() {
if ($(".placeholder").val() != '') {
$(".placeholder").next("label").hide();
}
$(".placeholder").focus(function() {
$(this).next("label").hide();
});
$(".placeholder").focusout(function() {
if ($(this).val() != '') {
$(this).next("label").hide();
} else {
$(this).next("label").show();
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment