开发者

how to read a textbox value excluding commas using jquery

My requirement is to read a textbox value with a currency formatted number. eg: 3,500

How to read the textbox value excluding comma in the number? C开发者_运维技巧an anyone please help me in doing this using jquery?


$('input').val().replace(',', '');


Get the value, split it (by comma), then join it back together

$('#box').val().split(',').join();


var value = Number($("input:text").val().replace(/[^0-9\.]+/g,""));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜