I have a text input and a textarea and I'm passing the value from the input to the textarea. I am trying to do, when you type something in the input and you stop, after 2 seconds show the values to the textarea.
In this example the textarea gets the input's value instantly:
So i want, when you type and stop, after 2 seconds give the value.
How can I achieve this? I tried to use setTimeout
but when the 2 seconds pass, then it keeps getting the value instantly. So basically it works for the first 2 seconds.