javascript - Replacing comma with dot Char -
i have made calculation app in appjs. basicly bunch of: <input type=number> fields. to make more user friendly thought should replace commas dots, javascript can use actual values calculate. i've tried doing this following pice of code: $("input[type=number]").keyup(function(e){ var key = e.which ? e.which : event.keycode; if(key == 110 || key == 188){ e.preventdefault(); var value = $(this).val(); $(this).val(value.replace(",",".")); } }); in explorer 9, works expected: see fiddle but since app.js uses chromium guess thats happens in chromium. how can work around this? this happens in app: when enter number containing comma char. comma char moved right , when input box loses focus, comma removed (probably since comma char isn't allowed in type=number) when value of <input type=number> isn't valid, blank string returned. check doing ...