Curriculum
Course: HTML Basic
Login

Curriculum

HTML Basic

HTML Introduction

0/1

HTML Editors

0/1

HTML Attributes

0/1

HTML Paragraphs

0/1

HTML Formatting

0/1

HTML Comments

0/1

HTML Favicon

0/1

HTML Page Title

0/1

HTML Iframes

0/1

HTML Java Script

0/1

HTML File Paths

0/1

HTML Symbols

0/1
Text lesson

Input Restrictions

Below are some typical input limitations:

Attribute

Description

checked

Indicates that an input field should be initially selected upon page loading (applicable to type=”checkbox” or type=”radio”).

disabled

Specifies that an input field should be inactive.

max

Specifies the upper limit for an input field’s value.

maxlength

Specifies the maximum character limit for an input field.

min

Specifies the lower limit for an input field’s value.

pattern

Specifies a regular expression for validating the input value.

readonly

Specifies that an input field is read-only and cannot be modified.

required

Specifies that an input field must be completed and cannot be left empty.

size

Specifies the width of an input field in terms of characters.

step

Specifies the allowable numeric intervals for an input field.

value

Specifies the initial value for an input field.

In the next chapter, you’ll explore input restrictions. The example shows a numeric input field with values between 0 and 100, incremented by 10, and a default value of 30.

Example

<form>
  <label for=”quantity”>Quantity:</label>
  <input type=”number” id=”quantity” name=”quantity” min=”0″ max=”100″ step=”10″

value=”30″>
</form>