Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

onEnter input field react

 <input
     onKeyPress={(e) => {
          if (e.key === "Enter") {
              this.setState({ message: e.target.value },
                () => {
                        alert(this.state.message);
                       });
              }
      }}
   type="text"
 />
Source by www.google.com #
 
PREVIOUS NEXT
Tagged: #onEnter #input #field #react
ADD COMMENT
Topic
Name
7+1 =