Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

read keyboard reactjs

handleKeyPress = (event) => {
  if(event.key === 'Enter'){
    console.log('enter press here! ')
  }
}
render: function(){
     return(
         <div>
           <input type="text" id="one" onKeyPress={this.handleKeyPress} />
        </div>
     );
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #keyboard #reactjs
ADD COMMENT
Topic
Name
3+5 =