I have pain-time when making input that only allows float number with jquery library. my code can\'t prevent chacacter \".\" when it\'s becoming first input, can anyone guid
I use this - works for keyboard input or copy and paste
$('input.float').on('input', function() {
this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');
});
Explanation: