How to get input textfield values when enter key is pressed in Reactjs?

Posted by Rohit Kumar | Updated on

If you want to get input textfield values when enter key is pressed in Reactjs? Use onKeyDown event, and inside that check the key code of the key pressed by user. Key code of Enter key is 13, check the code and put the logic there.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers