Take the 2-minute tour ×

I'm coding a fallback for browsers with no placeholder attribute support. What I've come up with works perfectly in all browsers except IE6.

The problem is this: after focusing either of the two fields, the placeholder text disappears as expected, but I can't type or paste any text into the fields! Sometimes I get an "Error 84 - Unspecified Error" but most of the time, there is no error at all.

I've uploaded the problematic code in it's simplest form at http://jsfiddle.net/CMWHx/ (code is also below)

This really is driving me crazy, to the point where I'm starting to think that my copy of IE6 is dodgy (it's a MultipleIE install), so I'd appreciate it if any of you with copies of IE6 could quickly check the link above and confirm that you're experiencing the same problem as I am.

Thanks in advance :)


<input id="email_input" type="email" placeholder="Email" required="required" />
<input id="password_input" type="password" placeholder="Password" required="required" />

JavaScript (jQuery 1.6.2)

$("#email_input").val("Email").focus(function() {
    if ($(this).val() == "Email")
}).blur(function() {

$("#password_input").hide().after("<input id=\"password_placeholder\" value=\"Password\" />").blur(function() {
$("#password_placeholder").focus(function() {
share|improve this question
Live links are a great adjunct to a question, but always post the relevant code in the question as well. Two reasons. 1. People shouldn't have to follow a link to help you. 2. StackOverflow is meant to be a resource not just for you now, but for others having a similar issue in the future. External links can get moved, modified, deleted, etc. By making sure the relevant code is in the question, we ensure that the question (and its answers) remain useful for a reasonable period of time. –  T.J. Crowder Jul 27 '11 at 21:51
@T. J. Crowder - thanks for the comment, I've added the code to the post –  chigley Jul 27 '11 at 21:54

4 Answers 4

up vote 0 down vote accepted

I saw a similar issue to what you described in a Windows 7 VM running IE6 via the old Xenocode sandboxed IEs (including the Error 84 on page load).

But then I fired up a Windows XP VM with a native, never-updated IE6, and can load your fiddle there with no errors, and the code works as intended.

So, I think you're OK here.

share|improve this answer


I can type in the fields on IE6. The fake placeholders disappear and what I type shows up, both when I focus with the mouse and by tabbing with the keyboard.

share|improve this answer

I tested this in IETester under IE6 and it appears to function correctly. The values in the fields were retained after clicking back and forth and i was able to type in them.

share|improve this answer

Unrelated to your issue, but as a tip you can do this by giving the input a default value, then checking the current value with the default, e.g.

<input value="email" 
 ... >

Of course you can implement it however you like, the above just shows the strategy.

share|improve this answer
That works for all fields except for type="password". For those fields the default text will show up as dots, which isn't the intended behavior. For password fields you have to swap out input elements, as described above. –  threejeez Feb 27 '12 at 18:13

Your Answer


