title: Check this javascript for making a meme
body: <p>Below is an HTML code that i made. Actually, the issue is that when I am calling function get() onclick there is no changes appeared in my browser. However, upon clicking multiple time on the submit button show an instant change in appearence which i want but for very less duration of time (say 0.1second).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var t = "top Text here";
  var b = "bottom Text";
  var i = "https://images.pexels.com/photos/1385326/pexels-photo-1385326.jpeg";
  console.log(t, b, i);
  memeCanvas();
  
  
  function get() {
    t = document.getElementById("topText").value;
    b = document.getElementById("botText").value;
    i = document.getElementById("imgLink").value;
    console.log(t, b, i);
    memeCanvas();
  }
  
  function memeCanvas() {
    var c = document.querySelector("#c");
    var ctx = c.getContext("2d");
    var image = new Image();
  
    image.onload = function() {
      console.log("Image Loaded");
  
      ctx.drawImage(image, 0, 0, 400, 400);
  
      ctx.fillStyle = "white";
      ctx.fillRect(0, 0, 400, 50);
      ctx.fillRect(0, 350, 400, 50);
      ctx.strokeText(t, 10, 10);
  
      ctx.strokeStyle = "Black";
      ctx.strokeRect(0, 0, 400, 50);
      ctx.strokeRect(0, 350, 400, 50);
      ctx.strokeText(b, 0, 370);
    }
    image.src = i;
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>canvas {}</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
  
    &lt;canvas id="c" width="400" height="400"&gt;&lt;/canvas&gt;
    &lt;form&gt;
      &lt;input type="text" id="topText" value="hahaha"&gt;
      &lt;input type="text" id="botText" value="nooo"&gt;
      &lt;input type="text" id="imgLink" value="chicken.jpg"&gt;
      &lt;!--*here chick.jpeg is an image stored in my computer */--&gt;
      &lt;input type="submit" onclick="get()"&gt;
    &lt;/form&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>