Well,
I did some workarround, and see a site
http://robertnyman.com/2011/05/02/h...tive-approach-introducing-roberts-playground/
which states with some better words ...
"And honestly, I must say that that is quite a nice way to do it. When you
have set focus to the field, you might have forgotten what the hint said,
but if it’s still there it makes thing a bit easier."
If you see some sites, such as facebook on IPAD - you see that behaviour I
meant.
That's exactly what I want, but I didn't succeed implement the code behinds
that site (I think that javascript has some problem ...)
Can you lead me to some better source (maybe jquery?)
Thanks
"Jukka K. Korpela" wrote in message
2013-01-11 10:07 said:
I want to make an input tag, with placeholder.
Can I make the placeholder be visible, even I focus on the field (if the
input field is not empty, that means at least one character on the input
field, I want to make the placeholder invisible)?
That would be against the very idea of the attribute:
http://www.w3.org/TR/html5/forms.html#the-placeholder-attribute
The HTML5 CR is somewhat vague (perhaps intentionally) as regards to
whether the placeholder text becomes visible on focus or when the field
content becomes nonempty. But it explicitly say that it may become
invisible on focus.
So if you want something else, you need to do it yourself. A simple
setup is to position a <span> element in the same place as the <input>
element, with a larger z-index, and have event handlers in the <input>
element to detect its becoming nonempty, in which case the z-index value
is changed to hide the "placeholder".
You would then need to decide whether the "placeholder" should become
visible again if the <input> content becomes empty again (e.g., the user
has written one character, then deletes it).