Skip to content

Instantly share code, notes, and snippets.

@pepelsbey
Last active November 29, 2023 11:39
Show Gist options
  • Save pepelsbey/3c66271d7cc1f966129170bf6e097c15 to your computer and use it in GitHub Desktop.
Save pepelsbey/3c66271d7cc1f966129170bf6e097c15 to your computer and use it in GitHub Desktop.
commentArea.addEventListener('keydown', autosize);
function autosize () {
var el = this;
setTimeout(function () {
el.style.cssText = 'height:auto;';
el.style.cssText = 'height:' + el.scrollHeight + 'px';
}, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment