+ 1

Alerting Invalid

How to alert invalid for a negative input in JavaScript?

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