Alerting Invalid | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Alerting Invalid

How to alert invalid for a negative input in JavaScript?

9th May 2018, 4:10 AM
love
2 Respuestas
+ 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