Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save clare485/5755849 to your computer and use it in GitHub Desktop.
Save clare485/5755849 to your computer and use it in GitHub Desktop.
placeholder in input for mailchimp widget
//add placeholder for subscribe form
$(".mc_input").focus(function(){
showEmptyLabels();
$(this).siblings("label").stop().fadeOut();
});
$(".mc_input").blur(function(){
showEmptyLabels();
});
$(".mc_merge_var label").bind("click", function() {
$(this).siblings("div").find("input, textarea").focus();
});
function showEmptyLabels() {
$(".mc_input").each(function(){
if( $(this).val() == "") {
$(this).siblings("label").fadeIn();
}
});
}
@ejntaylor
Copy link

Nice Gist - Have forked with CSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment