开发者

how to read a textbox value excluding commas using jquery

开发者 https://www.devze.com 2023-04-04 19:11 出处:网络
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 t

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

精彩评论

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