title: Converting HTML text to an Image- Javascript
body: <p>I am new to this. I am just trying to get a single line of text to be converted to an image. </p>
  
  <p>This is the javascript</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Html to image&lt;/title&gt;    
          &lt;script type="text/javacript"&gt;
              $(function () {
                  $("#show_img_btn").click(function () {
                      html2canvas("#the_text", {
                          onrendered: function (canvas) {
                              $("&lt;img/&gt;", {
                                  id: "image",
                                  src: canvas.toDataURL("image/png"),
                                  width: '95%',
                                  height: '95%'
                              }).appendTo($("#show_img_here").empty());
                          }
                      });
                  });
              });
          }
          &lt;/script&gt;
  </code></pre>
  
  <p>This is the line of code I wish to covert to an image and display the image in a div on button click</p>
  
  <pre><code>    &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="the_text"&gt;Hey! Im a text! I will be converted to an image&lt;/div&gt;
          &lt;/br&gt;
  
          &lt;button id="show_img_btn"&gt;Convert to Image&lt;/button&gt;
          &lt;div id="show_img_here"&gt;&lt;/div&gt;
      &lt;body&gt;
  &lt;/html&gt;
  </code></pre>