Languages
[Edit]
EN

HTML - display input element's placeholder text

0 points
Created by:
Eshaal-Wilkinson
384

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

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