Possible Duplicate:
Is there a (built-in) way in JavaScript to check if a string is a valid number?
i want to check whether a textbox contains a numeric value or a string using javascript i used this.
var query=getquerystring()
if(isNaN(query))
{
alert("query is a string");
}
else{
alert("query is numeric");
}
where getquerystring() is a function as
function getquerystring() {
var query=document.getElementById("queryString").value;
return query;
}
but when i enter a number 1234 in textbox still getting query is a string. please tell me what is wrong in my code, and suggest me some solution.