Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Placeholder attribute on input tags for IE?

I know that Internet Explorer doesn't support the placeholder attribute for input tags, but surely in 2012 there must be another solution for IE?

like image 837
DextrousDave Avatar asked Apr 26 '12 14:04

DextrousDave


People also ask

How do you put a placeholder in input?

The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format). The short hint is displayed in the input field before the user enters a value.

What is placeholder attribute in HTML?

The placeholder attribute specifies a short hint that describes the expected value of a input field / textarea. The short hint is displayed in the field before the user enters a value.

Does email use placeholder attribute?

You can apply the placeholder attribute to input fields like text , email , tel , search or URL . It can also be applied to a textarea .

Can we use placeholder in label?

The placeholder attribute is essentially invisible to screen readers, so it can be used in conjunction with <label> , however it should not be used as a substitute for a <label> .


2 Answers

I wrote a jQuery plugin a while back that will add placeholder support to any browser that does not support it.

Placeholder Text in IE

like image 159
corymathews Avatar answered Sep 18 '22 14:09

corymathews


Actually, IE does support the placeholder attribute in 2012 (Version 10). Couple this with a polyfill for older browsers, and you should have a well-rounded solution to your problem.

like image 25
Sampson Avatar answered Sep 16 '22 14:09

Sampson