title: Add Href to canvas element
body: <p>I am using <a href="https://github.com/mpalmerlee/HexagonTools" rel="nofollow noreferrer">HexagonTools</a> to draw hexagon using canvas.</p>
  
  <p>I need to add an href link to elements of canvas.</p>
  
  <p>I have tried this code:</p>
  
  <pre><code>function drawHexGrid()
  {
  var linkText="http://stackoverflow.com";
  var linkX=5;
  var linkY=15;
  var linkHeight=10;
  var linkWidth;
  var inLink = false;
  
      var grid = new HT.Grid(800, 600);
      var canvas = document.getElementById("hexCanvas");
      var ctx = canvas.getContext('2d');
      ctx.clearRect(0, 0, 800, 600);
      for(var h in grid.Hexes)
      {
          grid.Hexes[h].draw(ctx);
          linkWidth=ctx.measureText(linkText).width;          
               canvas.addEventListener("mousemove", on_mousemove, false);
  canvas.addEventListener("click", on_click, false);
  
      }
  }
  </code></pre>
  
  <p>But this is not working, I need a simple example on how to develop this, I have already  looked at this <a href="https://stackoverflow.com/questions/6215841/create-links-in-html-canvas">SOF Question</a>
  But I couldn't develop it</p>