placeholder even if focus
I am using an input text in my PHP project for email address and password. I made the place holder for both so it will be easy for users to know what is every textbox form. but when I load the page the email address textbox will be autofocus therefore it will lose the placeholder then user needs to take the focus just to know what's this textbox?
Is there anyway to keep the placeholder text even when the cursor is focused so it will only be disappeared when the user starts typing.
The simplest way would be, do not autofocus on that element.
If that's not acceptable, how about pre-setting the element value and select all text?
How about giving the textbox a label? There's an element for that. <label>.
You can also look at, for example, the twilio page to see how they set their placeholder text (at a wild guess it's probably something to do with the "placeholder" attribute).
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)