const App = () => {
const handleSubmit = (event) => {
event.preventDefault();
console.dir(event.target.elements)
alert(`FirstName: ${event.target.elements.fname.value}, LastName: ${event.target.elements.lname.value}`)
}
return (
<form onSubmit={handleSubmit}>
<label htmlFor="fname">First name:</label><br />
<input type="text" id="fname" name="fname" defaultValue="Jone" /><br />
<label htmlFor="lname">Last name:</label><br />
<input type="text" id="lname" name="lname" defaultValue="Doe" /><br /><br />
<input type="submit" value="Submit" />
</form>
)
}