One year ago, I was looking for about autoresize textarea and I found it here, at that time this script works fine in jsfiddle, but now it does not work, I got an error message on console browser looks like :
Uncaught ReferenceError: autoresize is not defined
I tried to make it on my computer as index.html
, and it works.
My question, why is it not working now in jsfiddle? Sorry, maybe my question is not so important, I'm just curious, is this an error in jsfiddle, or error in script?
function autoresize(textarea) {
textarea.style.height = '24px';
textarea.style.height = textarea.scrollHeight + 12 + 'px';
}