input element max size

maxlength attribute sets the max lengh in term of character number for an input text field.

 
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
      <form method="post" action="http://yourServer/form">
            <p>
                  <label for="name"> Name: 
                     <input maxlength="10" id="name" name="name" />
                  </label>
            </p>
            <p>
                  <label for="city"> City: 
                     <input size="10" id="city" name="city" />
                  </label>
            </p>
            <p>
                  <label for="fave"> Survey: 
                      <input size="10" maxlength="10" id="fave" name="fave" />
                  </label>
            </p>
            <button type="submit">Submit Vote</button>
      </form>
</body>
</html>
  
Click to view this demo.
Home 
  HTML CSS Book 
    HTML  

input:
  1. <input> element
  2. input element max size
  3. input text field size
  4. input text field initial value
  5. input text field placeholders(gray text)
  6. Using a Data List
  7. Read-Only input text field
  8. Disabled Text Boxes
  9. input element for password input
  10. Using the input Element to Create Buttons
Related: