HTML step Attribute

HTMLWeb DevelopmentFront End Technology

The HTML step attribute define a number interval for an <input> element in an HTML document.

Syntax

Following is the syntax −

<input step=”number”>

Let us see an example of HTML step Attribute −

Example

Live Demo

<!DOCTYPE html>
<html>
<style>
   body {
      color: #000;
      height: 100vh;
      background-color: #8BC6EC;
      background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
      text-align: center;
   }
</style>
<body>
<h1>HTML step Demo</h1>
<p>Enter the number of order:</p>
<input type="number" step="5" value="0">
</body>
</html>

Output

Now enter any number and then try to increment or decrement it by using arrow up/down key.

raja
Published on 23-Sep-2019 12:54:50
Advertisements