Languages
[Edit]
EN

HTML - text input

3 points
Created by:
Kevin
367

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

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