disable on typing e on input code example
Example 1: prevent user from typing e,+,- from number input
var inputBox = document.getElementById("inputBox");
var invalidChars = [
"-",
"+",
"e",
];
inputBox.addEventListener("keydown", function(e) {
if (invalidChars.includes(e.key)) {
e.preventDefault();
}
});
Example 2: prevent user from typing e,+,- from number input
<input type="number" id="inputBox" />