I have a text box and am trying to create autosave for it. I want to save the contents of such a text area if 5 seconds have passed and there was no key press:
function autosaving(){
alert('saved');
}
And here is the text box:
<textarea class="mytextarea" rows="4" cols="50"></textarea>
I want to execute this function 5 seconds after I inserted the last character in this text box. In other words, I want to run this function if 5 seconds have passed and there is no new value in the text box. How can i do this?
source
share