Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

autofocus react

const emailInputRef = React.useRef(null);

React.useEffect(()=>{
  emailInputRef.current.focus();
}, []);

<input type="email" name="email" ref={this.emailInputRef} />
Source by surajsharma.net #
 
PREVIOUS NEXT
Tagged: #autofocus #react
ADD COMMENT
Topic
Name
3+6 =