Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

allow only letters javascript

document.getElementById('inputid').onkeypress=function(e){
    if(!(/[a-z ]/i.test(String.fromCharCode(e.keyCode)))) {
        e.preventDefault();
        return false;
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: end code nodejs 
Javascript :: javascript change url without reload 
Javascript :: century from year javascript 
Javascript :: get device type using javascript 
Javascript :: document queryselector click event 
Javascript :: fs.writefile 
Javascript :: Data path "" should NOT have additional properties(es5BrowserSupport 
Javascript :: image border shadow react native 
Javascript :: react get input value on button click functional component 
Javascript :: jest check buffer 
Javascript :: initialize json array 
Javascript :: unpack array into variables javascript 
Javascript :: scroll to top in react 
Javascript :: console regex 
Javascript :: add mousedown event listener javascript 
Javascript :: play a sound wiith js 
Javascript :: made clickable url in js 
Javascript :: Uncaught TypeError: this is undefined ApolloClient ApolloClient.ts:72 
Javascript :: js clean nested undefined props 
Javascript :: detect mi browser 
Javascript :: Could not find router reducer in state tree, it must be mounted under "router" 
Javascript :: javascript find all href with same value 
Javascript :: check if a string is alphanumeric 
Javascript :: remove a particular element from array 
Javascript :: Cannot download "https://github.com/sass/node-sass 
Javascript :: angular amber theme 
Javascript :: current time in javascript 
Javascript :: first remove active class from classlist and append to current element using javascript 
Javascript :: how to communicate between nodejs applications 
Javascript :: move an element into another jquery 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =