Created
November 11, 2013 21:08
-
-
Save anneallen/7420354 to your computer and use it in GitHub Desktop.
Add Placeholder text to wordpress login forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JavaScript Document | |
jQuery(function ($) { | |
/* You can safely use $ in this code block to reference jQuery */ | |
$(document).ready(function(){ | |
$('form').find('input[name="log"]').each(function(ev) | |
{ | |
if(!$(this).val()) { | |
$(this).attr("placeholder", "Username"); | |
} | |
}); | |
}); | |
$(document).ready(function(){ | |
$('form').find('input[name="pwd"]').each(function(ev) | |
{ | |
if(!$(this).val()) { | |
$(this).attr("placeholder", "Password"); | |
} | |
}); | |
}); | |
/* You can safely use $ in this code block to reference jQuery */ | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What about localize support? I think you have to use wp_localize_script