From the course: HTML & CSS: Creating Forms
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Number input type - HTML Tutorial
From the course: HTML & CSS: Creating Forms
Number input type
- [Instructor] If you need to collect numeric data, there are several input types that can be used. In this video, we'll look at the number input type, as well as attributes you can use to require users to enter data in a certain format. First is the number input type. This is used to collect either positive or negative numbers, including decimals. So, going to my page. On line 12, I'm going to enter an input type equals number, and then, for name, I'm just going to call this number and add the ID. Label for equals number. And number is what the user will see on the page. And then save and go to the browser, and there I have my field to enter a number. Now, I can enter numbers here. What's interesting, it won't let me enter anything that's not a digit, so right now, you can't see, but I'm typing letters but nothing is happening. It'll allow me to enter any digits, the plus or minus sign and the period for decimal point. So using this field is useful if you want to make sure that the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Basic form structure7m 44s
-
(Locked)
Text, email, and URL input types6m 57s
-
(Locked)
Number input type6m 3s
-
(Locked)
Date and time input types6m 40s
-
(Locked)
Radio buttons3m 47s
-
(Locked)
Select5m 29s
-
(Locked)
Textarea and additional input types7m 15s
-
(Locked)
Submit and other types of buttons5m 6s
-
(Locked)
Attributes used in forms6m 51s
-
-
-
-
-