w3schools form page code example

Example 1: html text box

<!-- A <textarea> tag (better for multi-line text)-->
<textarea cols="4" rows="5">
Some text inside the text box.  
See https://www.w3schools.com/tags/tag_textarea.asp
</textarea>

<!-- An <input> type text tag (better for single-line text) -->
<input type="text" value="Some text inside the text box">
<!-- See https://www.w3schools.com/tags/att_input_type_text.asp -->

<!-- Using contenteditable (not recommended) -->
<p contenteditable="true">Some text inside the text box</p>
<!-- See https://www.w3schools.com/tags/att_global_contenteditable.asp -->

Example 2: html form

<form action="/action.php">
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" value="Mike"><br><br>
  <label for="lname">Last name:</label><br>
  <input type="text" id="lname" value="Walker"><br><br>
  <input type="submit" value="Submit">
</form>

Html By Duco Defiant Dogfish on Feb 11 2020
<form action="/action_page.php">
  First name:<br>
  <input type="text" name="firstname" value="Mickey"><br>
  
  Last name:<br>
  <input type="text" name="lastname" value="Mouse"><br><br>
  
  <input type="submit" value="Submit">
</form>

Tags:

Html Example