HTML Placeholder browser compatibility

NoodleOfDeath picture NoodleOfDeath · Oct 23, 2010 · Viewed 58.7k times · Source

What browsers support the placeholder html tag for text inputs? Does Internet Explorer support it? (I have a JavaScript placeholder that I can use for the browsers that do not support it.)

<input type=TEXT placeholder="placeholder here" />

Answer

Jera picture Jera · Jan 2, 2013

For anyone interested, this is the jQuery Fallback that I use
I use it with jQuery Validation Engine.
Replace FORMCLASS with the class of your form.

<!-- IF IE - use Placeholder Fallback -->
<!--[if lt IE 10 ]>
<script>
  $(".FORMCLASS").find('[placeholder]').each(function(){ 
    $(this).val($(this).attr('placeholder'));
    $(this).focus(function() {
      if ($(this).attr('placeholder')==$(this).val()) {
        $(this).val('');
      }
    });
  });
</script>
<![endif]-->