0% found this document useful (0 votes)
3 views7 pages

Number Type: by Kirthickkumar AR 21CCU028 HTML

The document explains the use of the <input type='number'> in HTML for entering numeric values, including attributes like max, min, value, and step to control input restrictions and behavior. It emphasizes that this input type is suitable for incremental numbers and not for non-numeric values like postal codes or credit card numbers. Additionally, it discusses the placeholder attribute for providing hints to users about the expected input format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Number Type: by Kirthickkumar AR 21CCU028 HTML

The document explains the use of the <input type='number'> in HTML for entering numeric values, including attributes like max, min, value, and step to control input restrictions and behavior. It emphasizes that this input type is suitable for incremental numbers and not for non-numeric values like postal codes or credit card numbers. Additionally, it discusses the placeholder attribute for providing hints to users about the expected input format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

NUMBER TYPE

By
Kirthickkumar AR
21CCU028
HTML
Input type
 The <input type=“number”>
defines a field for entering a
number. Use the following
attributes to specify restrictions:
max – specifies the maximum
value allowed. Min – specifies the
minimum value allowed.
VALUE
A number representing the value of the
number entered into the input. You can
set a default value for the input by
including a number inside the value
attribute, like so:
USING NUMBER INPUTS
 The number input type should only be used for
incremental numbers, especially when spinbutton
incrementing and decrementing are helpful to user
experience. The number input type is not
appropriate for values that happen to only consist of
numbers but aren’t strictly speaking a number, such
as postal codes in many countries or credit card
numbers. For non-numeric inputs, consider using a
different input type, such as <input type=“tel”> or
other <input> type with the inputmode attribute:
CONTROLLING STEP SIZE
 By default, the up and down buttons provided for
you to step the number up and down will step the
value up and down by 1. You can change this by
providing a step attribute, which takes as its value a
number specifying the step amount. Our above
example contains a placeholder saying that the
value should be a multiple of 10, so it makes sense
to add a step value of 10.
PLACEHOLDER
 BHThe placeholder attribute is a string that
provides a brief hint to the user as to what
kind of information is expected in the field. It
should be a word or short phrase that
demonstrates the expected type of data,
rather than an explanatory message. The
text must not include carriage returns or line
feeds.
Thankyou

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy