Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html
css
step
communitycreator

What is the step attribute in HTML?

Behzad Ahmad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

In HTMLHypertext Markup Language, the step attribute is used to specify the legal step size of the <input> elements. The default value of stepping is 1.

For example, the possible legal values should be …,-2,0,2,4,… if the stepping value is 2.

This attribute is used with the following data types: number, date, month, time, week, and range.

Syntax


<input step = "value">

Parameters

This attribute takes value as its single argument.

Example

Explanation

In the above example, we set the value of step as 2. Due to this, it only shows the values which belong to step size 2.

RELATED TAGS

html
css
step
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring