I just want to know, how to show a anything in a HTML body when the button is clicked. Is there anythin like echo in php
this is my appTodo.js code....
import React, { useState } from 'react'
export default function AddTodo() {
const [input, setInput] = useState("");
const onChange = (e) => {
setInput(e.target.value)
}
const handleOnClick = () => {
console.log(input)
setInput("")
}
return (
<div className='container my-3 col-6'>
<form>
<input className="form-control" onChange={onChange} type="text" placeholder="What to do?" value={input} />
<button id='addbtn' onClick={handleOnClick} type="button" className="btn btn-dark my-3">Add</button>
</form>
</div>
)
}