js限制输入框只能输入两位小数点

 通过onimput事件和正则实现

<input
    type="number"
    oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">