-
-
Save googlebe/85add0b2462dc0479a8578f9ff54311d to your computer and use it in GitHub Desktop.
Add Placeholders To WordPress Login Form And Remove Labels
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
// ---------------------------------------------------- | |
// Adding the placeholders in textfields of login form | |
// ---------------------------------------------------- | |
jQuery(document).ready(function($) { | |
$('#loginform input[type="text"]').attr('placeholder', 'Username'); | |
$('#loginform input[type="password"]').attr('placeholder', 'Password'); | |
$('#loginform label[for="user_login"]').contents().filter(function() { | |
return this.nodeType === 3; | |
}).remove(); | |
$('#loginform label[for="user_pass"]').contents().filter(function() { | |
return this.nodeType === 3; | |
}).remove(); | |
$('input[type="checkbox"]').click(function() { | |
$(this+':checked').parent('label').css("background-position","0px -20px"); | |
$(this).not(':checked').parent('label').css("background-position","0px 0px"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment