input text react 2020
function LoginForm() {
const [email, setEmail] = React.useState("");
const [password, setPassword] = React.useState("");
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
api.login(email, password);
}
return (
<form onSubmit={handleSubmit}>
<div>
<label htmlFor="email">Email</label>
<input
type="email"
id="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
</div>
<div>
<label htmlFor="password">Password</label>
<input
type="password"
id="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
</div>
</form>
);
}
Also in JavaScript:
- how to get element by attribute value in javascript
- selector id jquery but is variable
- node.js
- preventive vs reactive
- moment for react
- document ready javascript vanilla
- graphql yoga access http headers
- react native activityindicator
- jquery get all select options
- electron disable menu
- change input placeholder text jquery
- ejs include dynamic partial
- jquery scroll down 1 pixel
- how to check if an element exists in an array of objects js
- aws lambda dynamodb nodejs scan
- Property 'find' does not exist on type NodeListOf
- UI-router accessing parent state from child
- testing library react hooks
- how to display current date and time in angular
- wait for loop to finish javascript
- vscode entenstion build
- return this javascript
- clear input jqueyr
- array js fill