diff --git a/jquery.placeholder.js b/jquery.placeholder.js index 2fb8109..dad08c9 100644 --- a/jquery.placeholder.js +++ b/jquery.placeholder.js @@ -22,7 +22,7 @@ }; // Submit handler on all forms containing input[placeholder] // Needs to be via .click() - $('form:has([placeholder]) input[type=submit]').click(function() { + $('form:has([placeholder]) :submit').click(function() { // if ($(this).has('.placeholder') never returns false here — WTF? if ($(this.form).find('.placeholder').length) { $(this.form).find('.placeholder:first').val('').focus().removeClass('placeholder'); diff --git a/jquery.placeholder.min.js b/jquery.placeholder.min.js index 05fc2f3..b5e51da 100644 --- a/jquery.placeholder.min.js +++ b/jquery.placeholder.min.js @@ -3,4 +3,4 @@ * @link http://github.com/mathiasbynens/Placeholder-jQuery-Plugin * @author Mathias Bynens */ -(function(a){a.fn.placeholder=function(){if(this[0]&&'placeholder' in document.createElement('input')){return this}function b(c){if(c.val()===''||c.val()===c.attr('placeholder')){c.addClass('placeholder').val(c.attr('placeholder'))}else{c.removeClass('placeholder')}}a('form:has([placeholder]) input[type=submit]').click(function(){if(a(this.form).find('.placeholder').length){a(this.form).find('.placeholder:first').val('').focus().removeClass('placeholder');return !1}});return a(this).each(function(){var c=a(this);if(c.is(':password')||!c.is(':input')){return}b(c);c.focusin(function(){if(c.val()===c.attr('placeholder')){c.val('').removeClass('placeholder')}}).focusout(function(){b(c)})})}})(jQuery); \ No newline at end of file +(function(a){a.fn.placeholder=function(){if(this[0]&&'placeholder' in document.createElement('input')){return this}function b(c){if(c.val()===''||c.val()===c.attr('placeholder')){c.addClass('placeholder').val(c.attr('placeholder'))}else{c.removeClass('placeholder')}}a('form:has([placeholder]) :submit').click(function(){if(a(this.form).find('.placeholder').length){a(this.form).find('.placeholder:first').val('').focus().removeClass('placeholder');return !1}});return a(this).each(function(){var c=a(this);if(c.is(':password')||!c.is(':input')){return}b(c);c.focusin(function(){if(c.val()===c.attr('placeholder')){c.val('').removeClass('placeholder')}}).focusout(function(){b(c)})})}})(jQuery); \ No newline at end of file