Hint Inside Textfield

How do I put hints inside the textField?

Example:




Name: [First Name] [Middle Name] [Last Name]

^Label ^textField   ^textField    ^textField



And when I input text, the hint should disappear. But if I remove text, the hint should reappear.

Any ideas?

If you’re happy for the feature to only work in modern browsers, use the HTML5 placeholder attribute.

If you want to offer broader support, you’ll need to use javascript.

Here’s the current state of support for the attribute:

http://caniuse.com/#feat=input-placeholder

As usual, IE support is the main problem.