troubleshooting Question

Javascript change input value

Avatar of Jamel_Prog
Jamel_ProgFlag for Afghanistan asked on
10 Comments2 Solutions418 ViewsLast Modified:
Hi Experts,

I am looking for a very simple code that can has a value on sign in inputs, so it will has username, but when click it will hide the username text so the user can enter his username. In case the user didn't write anything in the input and go out of the input, then username text should return.

I am using this:
<input type="text" value="username">
But by using this it will not be hidden when the user click on it, or return if the user didn't write any thing and take the selection out of the input.

Looking forward for your help, and thanks in advance

Join our community to see this answer!
Unlock 2 Answers and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros