0

I would like to use Autofocus and Placeholder in the same input Box. It works in most browsers except for Internet Explorer, the Autofocus cancels out the Placeholder. Could you tell me how to stop this from happening?

<html>
  <body>
  <input type="type" placeholder="PlaceHolder Text" autofocus="autofocus">  
  </body>
</html>
  • Have a look at this and i think would help you a bit. [Try This](http://devproconnections.com/html5/working-html5-web-forms-autofocus-and-placeholder-attributes) – Puttaa Aug 12 '15 at 08:07
  • [or try this for more](http://stackoverflow.com/questions/5522164/input-placeholders-for-internet-explorer) – Puttaa Aug 12 '15 at 08:09

1 Answers1

0

You can workaround with this:

http://samplacette.com/html-5-placeholder-autofocus-cross-browser-support-for-ie/

It explains the problem and gives you a polyfill to avoid it.

https://github.com/SamPlacette/placeholdr

good luck

Marcos Pérez Gude
  • 21,869
  • 4
  • 38
  • 69