on-internet
← Community

HTML - Keep placeholder when user types

Stack Overflow ·

I have an input like this: <input value="My text" placeholder="Placeholder"> When I type something in the input the placeholder text will disappear, that's quite obvious. Now, what I want to do is that I want the placeholder text to stay when the user types so you can see the placeholder text as a background text behind the original text: EDIT: I also want to be able to change the background-text using JavaScript.

Comments

Sign in or sign up to comment and upvote.

No comments yet.