Languages
[Edit]
EN

HTML - display input element's placeholder text

0 points
Created by:
Eshaal-Wilkinson
774

In this article, we would like to show you how to display the input element's placeholder text in HTML.

Quick solution:

// ONLINE-RUNNER:browser;

<input type="text" name="username" placeholder="Type your username" />

 

Practical example

In this example, we use the input element's placeholder attribute to display hint for the input element.

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<body>
  <label>
    <span>Username:</span>
  	<input type="text" name="username" placeholder="Type your username" />
  </label>
</body>
</html>

References

See also

Alternative titles

  1. HTML - display hint for input element
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join