i have a project, and i would want to know how i can to create a inpult field after an event of onClick?
I have that code:
onSubmitCell = event => {
const newCell = prompt("Please with new URL:");
const personCurrent = event.target.value;
axios.patch(`http://localhost:3004/employee/${personCurrent}`, {
cellphone: newCell
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.log(error);
});
}
What it do?
It get the value of alert and do the Patch to update the attribute of the object.
What do i want ?
Instead of open an alert, i would want that appeared an input, and i get the value of this input and did the Patch.
Someone would can help me ? Please?