I'm working on input validation, I dont want to use RegExp but I keep wondering why typeof is not working inside if statement or is anything wrong with my code
function myDom(){
var message = document.getElementById('show');
var xx = document.getElementById('demo').value;
try{
if(xx === "") throw "can not be empty";
if(typeof xx === "number") throw "can not be number";
//if(xx < 100) throw "less than hundreds!"
}catch(err){
message.innerHTML = "input " + err;
}
}