I want to use the HTML5 \"placeholder\" attribute in my code if the user\'s browser supports it otherwise just print the field name on top of the f
A bit late to the party, but if you're using jQuery or AngularJS you can simplify the method suggested above without using any plugins.
jQuery
typeof $('')[0].placeholder == 'string'
AngularJS
typeof angular.element('')[0].placeholder == 'string'
The checks are very similar, as AngularJS runs jQlite under the hood.