title: clicking text in an html5 canvas
body: <p>How do I program the canvas to set go = true; in regular js when you click on the word "play" on the canvas? if go = true, it starts the game. this code prints play onto the canvas. . this is my js code:</p>
  
  <pre><code>var canvas = document.getElementById("gameCanvas");
  var ctx = canvas.getContext("2d");
  canvas.width = 800;
  canvas.height = 336;
  
  
      var go = false;
  
      var reset = function() {
          //reset function
      };
  
      var main = function () {
      //main function
      };
  
      var menu = function () {
  
          ctx.clearRect (0 , 0 , canvas.width , canvas.height);
  
          ctx.fillStyle = "rgb(250, 250, 250)";
          ctx.font = "24px Helvetica";
          ctx.textAlign = "left";
          ctx.textBaseline = "middle";
          ctx.fillText("play", 32, 32);
      }
  
      if (go == true) {
          reset();
          var then = Date.now();
          setInterval(main, 1);
      }
      else {
          menu();
      }
  </code></pre>