import { Form, InputGroup, Button } from "react-bootstrap";
export default function About() {
---------------------> i want this function to perform addition but it is shown NaN even though i parseInt...........
**function add() {
let n1 = parseInt(document.getElementById("num1").value);
let n2 = parseInt(document.getElementById("num2").value);
document.getElementById("result").innerHTML = n1 + n2;
}**
return (
<> <h2>addition function</h2>
<div className="row">
<div className="col-6">
<InputGroup className="mb-3" id="num1">
<Form.Control
placeholder="number1" />
</InputGroup>
</div>
<div className="col-6">
<InputGroup className="mb-3" id="num2">
<Form.Control
placeholder="number2"
/>
</InputGroup>
</div>
<div className="col-6">
<InputGroup className="mb-3" id="res">
<Form.Control
placeholder="answer"
/>
</InputGroup>
</div>
<Button variant="dark" onClick={add} >Add</Button>
</div>
</>
);
}