title: How to fix manually resized textarea programatically
body: <p>I have one textarea with resize css property. I know how to resize it using javascript by setting <em>rows</em>, for e.g. </p>
  
  <p><em>document.querySelector('textarea').rows = "10";</em></p>
  
  <p>It works perfectly. Now when i resize textarea manually and then try to set rows using function, it wont work as expected. </p>
  
  <p>I have debugged the problem and it is due to height, When we resize textarea manually it adds height to the textarea and when i resize it programattically it doest add any height, and this is causing problem. </p>
  
  <p>Anyone knows how to fix it?</p>
  
  <p>Here is example.
  Click on below link:
  <a href="https://www.w3schools.com/code/tryit.asp?filename=G2O728X99KGS" rel="nofollow noreferrer">https://www.w3schools.com/code/tryit.asp?filename=G2O728X99KGS</a></p>
  
  <p>Click on Run button.</p>
  
  <p>Now click on <code>Resize Me</code> button</p>
  
  <p>You can see textarea is resized.</p>
  
  <p>Now resize textarea manually by dragging resize icon.</p>
  
  <p>Finally click on <code>Resize Me</code> button, there is no any change.</p>