title: how to copy the contents of <div> element and paste it to pdf using javascript without jsPDF
body: <p>I am developing a web application using JavaScript. in a certain case i want to extract the contents inside a div element and paste it to the pdf file when i click the link "download to pdf".</p>
  
  <p>I received some answers regarding this by using jsPDF lib, but is there any other way without using jsPDF? jsPDF is not supporting such things </p>
  
  <pre><code>    &lt;div id="panel"&gt;
        //some codes 
        &lt;a href=javascript:downloadPDF();&gt;Download to PDF&lt;/a&gt;
      &lt;/div&gt;
  
      &lt;script&gt;
       function downloadPDF()
       {
        what to write here to convert to PDF
       }
      &lt;/script&gt;
  </code></pre>