Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript how to get rid of e with number input

document.querySelector(".your_class").addEventListener("keypress", function (evt) {
    if (evt.which != 8 && evt.which != 0 && evt.which < 48 || evt.which > 57)
    {
        evt.preventDefault();
    }
});

// 0 for null values
// 8 for backspace 
// 48-57 for 0-9 numbers
Comment

PREVIOUS NEXT
Code Example
Javascript :: remove first element of array javascript 
Javascript :: javascript statement 
Javascript :: next js notifications 
Javascript :: do somthing after page completly load jqery 
Javascript :: disabling ctrl + s using javascript 
Javascript :: javascript add id to element with class 
Javascript :: lodash find duplicate element index 
Javascript :: substring methods example 
Javascript :: Escaping double quotation in javascript 
Javascript :: append textarea jquery with value 
Javascript :: currentTime(); javascript 
Javascript :: nestjs set swagger api keys 
Javascript :: puppeteer headless ubuntu server install required 
Javascript :: new line in rdlc expression 
Javascript :: sequelize raw query 
Javascript :: The element.InnerHTML Property 
Javascript :: react native get location 
Javascript :: filter react 
Javascript :: fs flies in dir 
Javascript :: regex 
Javascript :: dropzone react view photo 
Javascript :: settimeout method 
Javascript :: open youtube video at specific time javascript 
Javascript :: return nothing javascript 
Javascript :: change react native app name 
Javascript :: map a square to a circle 
Javascript :: js detect all images errors 
Javascript :: jquery onclick click 
Javascript :: jstl library 
Javascript :: js or 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =