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

The required Attribute

The input required attribute indicates that an input field must be completed before the form can be submitted.

This attribute is applicable to the following input types: text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file.

Example

An input field that is mandatory:

<form>
  <label for=”username”>Username:</label>
  <input type=”text” id=”username” name=”username” required>
</form>

The step Attribute

The step attribute sets the allowed numerical intervals for an input field, such as step=”3″ allowing values like -3, 0, 3, 6, etc. It works with min and max attributes to define a valid range and is compatible with input types like number, date, and time.

Example

An input field with defined allowable numerical intervals:

<form>
  <label for=”points”>Points:</label>
  <input type=”number” id=”points” name=”points” step=”3″>
</form>