+ 1
What it does mean by ! in this function?
function myFunction() { var inpObj = document.getElementById("id1"); if (!inpObj.checkValidity()) { document.getElementById("demo").innerHTML = inpObj.validationMessage; } }
1 Answer
+ 1
! is the not-operator
Meaning, that true becomes false and vice versa.
So in this example the validation message will be shown, if the object is not valid.
At least I assume so, I don't know much about JavaScript.
But ! is definitley the not-operator.
!true = false
!false = true