Although the html of a input is input type="number the user also can type characters "+","-","e","." https://stackoverflow.com/questions/39291997/how-to-block-e-in-input-type-number
document.querySelector(".your_class").addEventListener("keypress", function (evt) {
if (evt.which != 8 && evt.which != 0 && evt.which < 48 || evt.which > 57)
{
evt.preventDefault();
}
});