ryanseddon/H5F — pull request #61 by ericfreese (2014-09-07 02:13:39+00:00)
Title: Add placeholder class when input value matches placeholder attribute value on page load.

Hey,

I was having some trouble with placeholder styling in IE9. Steps to recreate were about like this:
- Load the page.
- Setup finds all elements with placeholder attribute and sets their values to the value of the placeholder attribute.
- Reload the page.
- IE9 (at least, but possibly other browsers too) maintains any input values that the user set when reloading
- So on page load, the inputs all have values equal to their placeholder attributes.
- Setup calls placeholder on all elements w/ the attribute set.
- When it gets to line 234, the value was not empty and the field is not focused, so the class does not get added and the field does not get the placeholder styles.

The fix I came up with was to check if the value is empty _OR equal to the placeholder_. On page reload, the value is equal, so it applies the class correctly.