Why can I not write a function and call a function using button in react.js? In this code, I want click button, an alert pop up and say that survey has submitted. How can i do it ?
function finish(){
alert('Survey Submitted! Thank you');
}
function Task3(){
return(
<div className="head">
<h1>Experiment</h1>
<h3>Task 3</h3>
<p>In Task 3, you will see the right answer of your guess. </p>
<div className="video">
<div> <MultiStep steps={steps}/> </div>
</div>
<button className="task3-finish" onSubmit = {finish} >Finish Thanks!</button>
</div>
)
}
export default Task3
onSubmit = {()=> finish()}