Share: Adding placeholder attr to wp login form

I just discovered this after searching and thought I would share. I was tasked with adding the Username and Password text to the background of the wordpress login form. The attribute 'placeholder' does this but I couldn't find any hooks that would allow me to add that attribute. You can change attributes but wp_login_form seems to filter that one out.

I have a js file, core-javascript.js that I add to my themes so I can easily add js snippets without adding a plugin. I also didn't want to add a login form plugin just for this.

I simply added the following lines to my core-javascript.js file:

$('#user_login').attr( 'placeholder', 'Username' );
$('#user_pass').attr( 'placeholder', 'Password' );

Hope you find that useful. It there are better solutions, please share!!