Jak opróżnić pole wejściowe w React
event.target.value = ''
//grab the target input and set it empty. you can use it in the onclick
event.target.value = ''
//grab the target input and set it empty. you can use it in the onclick
e.target.value = null;
cancelCourse = () => {
document.getElementById("create-course-form").reset();
}
render() {
return (
<form id="create-course-form">
<input />
<input />
...
<input />
</form>
);
}
Clear input field