bail early if we have built-in placeholder support

This commit is contained in:
Jeff Balogh 2010-05-14 09:14:53 -07:00
Родитель 2d882b7bad
Коммит 6ced985d0d
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -47,6 +47,10 @@ var format = function(s, args) {
/* Fake the placeholder attribute since Firefox doesn't support it. */
jQuery.fn.placeholder = function() {
/* Bail early if we have built-in placeholder support. */
if ('placeholder' in document.createElement('input')) {
return this;
}
return this.focus(function() {
var $this = $(this),
text = $this.attr('placeholder');