资 源 简 介
Creates a span overlaying specified input elements for purposes of displaying text in an input without changing the value.
Adapted from the code example at http://kyleschaeffer.com/best-practices/input-prompt-text/
Briefly (taken from the above page):
The prompt text appears inside the form field as soon as the page loads, so users immediately know what it’s for. Simple, right?
Why it Doesn’t Work
There are a number of problems you’ll encounter while implementing prompt text into your forms. Watch out for these caveats when you’re developing your own solution.
Input validation — if someone submits the form without first removing the prompt text, your prompt text is submitted in lieu of real data. Fixing this is a pain. Avoiding this entirely is recommended.
Prompt style — it’s best to style the prompt text so that it doesn’t look like real form data. Creativity is a virtue, but generally web users will expect light (