Languages
[Edit]
EN

HTML - text input

3 points
Created by:
Kevin
797

In this article, we would like to show you how to create text input element in HTML.

Quick solution:

// ONLINE-RUNNER:browser;

<input type="text" name="input-name" value="Initial value..." />

or just:

// ONLINE-RUNNER:browser;

<input name="input-name" value="Initial value..." />

 

Practical example

In this section, we use label to wrap input for better SEO and user experience (it means the input is described by the Field name:).

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<body>
  <label>
    <span>Field name:</span>
  	<input type="text" name="input-name" value="Some text ..." />
  </label>
</body>
</html>

References

Alternative titles

  1. HTML - input type text
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.

HTML - input element types

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