JSFiddle - React, Tailwind, and code Playground

by davidvandertuijn

HTML

Paste '€ 1.234,56'<br>
<input type="text" name="price" value="1.234,56 " />

JavaScript

$('input').bind("paste input", function(e) {
		var element = this;
		setTimeout(function () {
    	let val = $(e.currentTarget).val();
      val = val.replace(/[^\d.,-]/g, '');
  		$(element).val(val);
    }, 0);
});