andrewrjones/jquery-placeholder-plugin — pull request #12 by rogerhu (2013-03-16 10:04:25+00:00)
Title: Fix issue with .val() returning back the placeholder value.

I've been seeing a lot of sporadic JavaScript issues with the jQuery placeholder plug-in, and I traced it down to
the fact that the plug-in tries to override the jQuery val() function but does it incorrectly. If you
do a $('#').val() on an element in IE browsers, the placeholder value should not be returned back. However, it does.

This bug wouldn't be triggering JavaScript exceptions except for the fact that jQuery val() commands needs to be
chainable, and the bug in where the code was placed meant that it was returning a string back and breaking this contract.
In cases where the onblur event was being fired and the element's placeholder value wasn't set in time (which doesn't
happen that often and therefore hard to repro, this exception would be triggered.

I manually created this condition by triggering the onblur event and then adding the activeClass to force this line to be run:

$el.val($el.attr('placeholder')).addClass(opts.activeClass);

..and got the return condition to return '', thereby triggering an exception.