Skip to content

Instantly share code, notes, and snippets.

@jasonwarta
Created January 28, 2018 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonwarta/8c929881e53d6dd78764e5cbf4df9c53 to your computer and use it in GitHub Desktop.
Save jasonwarta/8c929881e53d6dd78764e5cbf4df9c53 to your computer and use it in GitHub Desktop.
window.onload = function(){
function textAreaAdjust(o) {
var elem = o.target;
elem.style.height = "1px";
elem.style.height = (10+elem.scrollHeight)+"px";
}
var elems = document.getElementsByTagName('textarea');
for(var ii=0;ii<elems.length;ii++){
elems[ii].addEventListener('keyup',textAreaAdjust,false);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment