I am new at Javascript and I wanted to know if there is a way to check if textfield input contains anything other than numbers.
I know how to do that in Java, but Ja
You can use isNaN() to check if the input is a number or not.
HTML:
JavaScript:
function checkInput() { var textCheck = document.getElementById("inputText").value; if(isNaN(textCheck)) { document.write("contains letters"); } else { document.write("only numbers"); } }