Answers for "autofocus react"

2

autofocus react

const emailInputRef = React.useRef(null);

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

<input type="email" name="email" ref={this.emailInputRef} />
Posted by: Guest on March-05-2021
-1

autofocus react

<!DOCTYPE html>
<html>
  <head> </head>
  <body>
    <label>
      Title
      <input type="text" autofocus value="Untitled" />
    </label>
  </body>
</html>
Posted by: Guest on July-01-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language