title: Element is undefined error in jsPDF
body: <p>I am trying to make an app in which the user can download a certain table as PDF. I am trying to use jsPDF for the purpose but due to some reasons or other , it is not working. The latest error which I am getting in the console is <code>TypeError: element is undefined</code> in the file <code>jspdf.plugin.from_html.js</code> . </p>
  
  <p>Here is my approach: </p>
  
  <p>I have the following headers:</p>
  
  <pre><code>&lt;script type="text/javascript" src="jspdf.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf.plugin.from_html.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf.plugin.split_text_to_size.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf.plugin.standard_fonts_metrics.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>One thing that may be noted here is the fact that <strong>My table is populated dynamically from values provided by my backend during the page load itself</strong></p>
  
  <p>The table looks like:</p>
  
  <pre><code>&lt;div id="huh"&gt;
  
  &lt;table class="table table-hover table-bordered" id="recent"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;
              Spent On
              &lt;/th&gt;
              &lt;th&gt;
              Amount
              &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt; 
  
  &lt;/table&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>The table contains actual data when I invoke the following script: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
       function demoFromHTML() {
           var doc = new jsPDF('p', 'in', 'letter');
           var source = document.getElementById('huh');
           var specialElementHandlers = {
               '#bypassme': function(element, renderer) {
                   return true;
               }
           };
  
           doc.fromHTML(
              $('#testcase').get(0), // [Refer Exact code tutorial][2]HTML string or DOM elem ref.
               0.5,    // x coord
               0.5,    // y coord
               {
                   'width': 7.5, // max width of content on PDF
                   'elementHandlers': specialElementHandlers
               });
  
           doc.output('dataurl');
      }
  
      &lt;/script&gt;
  
  &lt;button onclick="javascript:demoFromHTML();"&gt;PDF&lt;/button&gt;
  </code></pre>
  
  <p>I took some code from samples and examples. Any ideas where I am going wrong? 
  Thank You. </p>