HTML input type time tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

HTML input type time tag

i want my HTML input type time tag to only accept numbers and not letters or any other characters please help

19th Jul 2017, 10:36 AM
John Simbarashe Nhamoinesu
John Simbarashe Nhamoinesu - avatar
6 Answers
+ 2
<input type="num"> or use JS
19th Jul 2017, 10:48 AM
The Coding Sloth
The Coding Sloth - avatar
+ 2
congrats on the certificate john
19th Jul 2017, 5:18 PM
Karuma Tendai
Karuma Tendai - avatar
+ 1
u can directly use time attribute.. like <input type="time" name="time">
19th Jul 2017, 10:55 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
+ 1
use the isNaN() function, it will return false if it is a number and true if it isn't
19th Jul 2017, 11:04 AM
The Coding Sloth
The Coding Sloth - avatar
+ 1
ypu can input 0-9 and few characters https://code.sololearn.com/W4vPGEX11J4X/?ref=app
19th Jul 2017, 11:27 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
How do i do it with JS
19th Jul 2017, 11:02 AM
John Simbarashe Nhamoinesu
John Simbarashe Nhamoinesu - avatar