Asked 21 - hours , 4 - minutes ago
22 Nov 2016
Views 198
jaggy

jaggy posted

how to check value is Numeric in JavaScript ?

In JavaScript . given value is Numeric or not ?
i want to check the given number is Numeric or not in HTML Form . so i can validate it properly

In JavaScript or in jQuery , any solution helps.
Mitul Dabhi

Mitul Dabhi
answered Jan 21 '18 20:16

you can use regex to check given value is Numeric or not

 /^[0-9]+$/

use like this

var myVar =123;
var numericExpression = /^[0-9]+$/;
if(myVar .match(numericExpression)){
	alert(myVar +"is Numeric");
}
Edit Answer
Share
Post Answer