Javascript Regex Replace Produces <empty string>
I'm kinda at my wits end with this as it is not behaving like other examples I've tried online. I have some input validation for numbers: $('body').on("input", 'input[type="number"]', function(){ const regex = /[^0-9]/g; const val = $(this).val(); console.log(val.replace(regex, '')); Any…