The input element in HTML


 Create a Text Field:

  • In web development, there is always a need to take input from the users.
  • In HTML we have a special element designed for taking input from the users.
  • The input element is a convenient way to get input from a user.
  • You can create a text input like this:

        <input type="text">


  • Always note that the input element is self-closing.

Add Placeholder Text to a Text Field:

  • Placeholder text is what is displayed in your input element before the user has inputted anything.
  • You can create a placeholder text like this:

<input type="text" placeholder="this is placeholder text">

No comments:

Post a Comment