I have some onfocus/onblur handlers for a field that clears the default contents when focused, but only if the value equals the default value (so as to not remove any user input).
The field can also toggle between inputs. So rather than accepting a username, the user could click a button and it would accept an email address. This would require a different default value, such as "enter your email address". The actual property attribute defaultValue needs to be changed to allow my focus/blur handlers to work properly, using something like this:
$('input#ident-field').prop('defaultValue', 'enter your email address');
This doesn't seem to work because if you focus the field when it asks for an email address it doesn't clear it.
.prop(): It should be used when setting selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, or defaultSelected..data()instead