This is a program I found on the Internet:
<input type="text" name="total" onKeyUp="value=value.replace(/[^\d.]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d.]/g,''))"> The article originates from the fallen fish- https://www.duoluodeyu.com/48.html
After changing the html code of the input box to this way, every character entered or pasted will be detected. If it is not a number, the entered character will be automatically deleted. You can enter a decimal point, that is, you can enter a decimal point. The article originates from the fallen fish- https://www.duoluodeyu.com/48.html
The article originates from the fallen fish- https://www.duoluodeyu.com/48.html