title: im having textarea in html when i click the button i need to save the content inside the textarea as pdf file. how can i do it?
body: <p>This is my HTML code. I need to save the content as pdf, whatever I'm giving in the text area. By this code I'm facing two problems.</p>
  
  <ol>
  <li><p>I can save the pdf, but there is no content inside the textarea</p></li>
  <li><p>When I click the as pdf it downloading only once, not again.</p></li>
  </ol>
  
  <p>Please help me to solve this issue </p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
   &lt;html&gt;
   &lt;head&gt;
   &lt;title&gt;file&lt;/title&gt;
   &lt;/head&gt;
   &lt;script 
   src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"&gt;
   &lt;/script&gt;
   &lt;body id="target"&gt;
   &lt;p&gt; reason:&lt;/p&gt;
   &lt;div&gt;
   &lt;textarea id="content" rows="4" cols="70"&gt;&lt;/textarea&gt;
   &lt;/div&gt;
   &lt;div id="editor"&gt;&lt;/div&gt;
   &lt;button  id="cmd" onclick="save()"&gt;as pdf&lt;/button&gt;
    script src="https://code.jquery.com/jquery-1.12.3.min.js"&gt;&lt;/script&gt;
    &lt;script 
    src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js"&gt;
    &lt;/script&gt;
    &lt;script&gt;
    var doc= new jsPDF();
    var specialElementHandlers = {
    '#editor': function (element,renderer) {
     return true;
     }
     };
     $('#cmd').click(function () {
      doc.fromHTML(
     $('#content').html(), 15, 15, 
     { 'width': 170, 'elementHandlers': specialElementHandlers });
     doc.save('Reason.pdf'); 
      } );
     &lt;/script&gt;
     &lt;/body&gt;
     &lt;/html&gt;
  </code></pre>