Answers for "read keyboard reactjs"

4

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>
     );
}
Posted by: Guest on June-24-2020

Code answers related to "read keyboard reactjs"

Code answers related to "Javascript"

Browse Popular Code Answers by Language