jQuery for remove alpha characters from string.
If your string is :
var myString = ‘<jainish> 143.8 Text’;
and you want numeric value, dot and dash in your string then you have to use following jQuery
var myString = myString.replace(/[^\d.-]/g, ''); alert(myString)
And output will be :
143.8
If you want only numeric value then Following should do the trick.
var myString = myString.replace(/[^\d]/g, ''); alert(myString)
And output will be :
1438
If you have any queries, please do not hesitate to contact me at Jainish Senjaliya