Alerting Invalid | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Alerting Invalid

How to alert invalid for a negative input in JavaScript?

9th May 2018, 4:10 AM
love
2 Réponses
+ 3
var x = document.getElementsByTagName("input") if (x < 0){ alert("invalid input") } else alert("valid input") //you should use this on onsubmit event
9th May 2018, 4:53 AM
Fery Ardiansyah
Fery Ardiansyah - avatar
0
Thanks.
9th May 2018, 4:53 AM
love