Skip to content

Instantly share code, notes, and snippets.

@octavioamu
Created March 12, 2012 17:14
Show Gist options
  • Save octavioamu/2023432 to your computer and use it in GitHub Desktop.
Save octavioamu/2023432 to your computer and use it in GitHub Desktop.
Jquery: Placeholder ie polyfill
//Placeholder funcion
(function($){$.fn.extend({placeholder:function(){return this.each(function(){$(this).focus(function(){if($(this).val()==$(this).attr("placeholder")){$(this).val("");}}).blur(function(){if($(this).val()==""){$(this).val($(this).attr("placeholder"));}}).val($(this).attr("placeholder"));});}});})(jQuery); // Si es IE aplicar, colocar dentro del ready
if ($.browser.msie) {
$('input[placeholder]').placeholder();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment