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?
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
Yes, there is a quite easy solution for IE8 and IE9 because on grater versions of IE it already works. (IE10, IE11, etc)
This is the solution i found:
1. Detect Internet Explorer version
<!--[if lt IE 10]>
<script type="text/javascript">var ie = 9;</script>
<![endif]-->
<!--[if lt IE 9]>
<script type="text/javascript">var ie = 8;</script>
<![endif]-->
2. Fix the placeholder
if (typeof ie == 'undefined') var ie = 10;
if (ie == 8 || ie == 9){
$("input[placeholder]").each(function() {
this.value = $(this).attr('placeholder');
});
$("input[placeholder]").focus(function()
if (this.value == $(this).attr('placeholder')) this.value = '';
}).blur(function() {
if (this.value == '')
this.value = $(this).attr('placeholder');
});
}
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.
http://the.deerchao.net/PlaceHolder it works on ie without call any function...
Try this jQuery plugin developed by me
https://github.com/ramsunvtech/jQuery-Plugins/tree/master/IEPlaceHolder
We've been using this jQuery plugin in production for a few weeks now and it seems to be working great.
http://webcloud.se/code/jQuery-Placeholder/