Reset textarea height in javascript

Viewed 4033

I have a textarea (auto resizing) and I want to clear all of its contents including its height.

So far I've tried:

document.getElementById('textarea').value = '';

And :

document.getElementById('textarea').attribute('rows','1');

But both doesn't work.

EDIT :

I use autosize.js with this :

<textarea id="post" rows="1" title="Write something..." name="posttxt" placeholder="Write something..." role="textbox" autocomplete="off"></textarea>
3 Answers

Just a JQuery version, that I'm using when I close a modal on my project

$("#jobURL").attr("style", "").val("")
Related