title: svg.getScreenCTM is not a function?
body: <p>i need to draw textbox dynamically on svg but i am getting error as getScreenCTM is not a function so what can be the solution</p>
  
  <pre><code>var mousedownonelement = false;
  
  window.getlocalmousecoord = function (svg, evt) {
  
      editor.x = evt.clientX;
      editor.y = evt.clientY;
      var localpoint = editor.matrixTransform(svg.getScreenCTM().inverse());
      localpoint.x = Math.round(localpoint.x);
      localpoint.y = Math.round(localpoint.y);
      return localpoint;
  };
  
  window.createtext = function (localpoint, svg) {
      var myforeign = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject')
      var textdiv = document.createElement("div");
      var textnode = document.createTextNode("type the text.....");
      textdiv.appendChild(textnode);
      textdiv.setAttribute("contentEditable", "true");
      textdiv.setAttribute("width", "auto");
      myforeign.setAttribute("width", "100%");
      myforeign.setAttribute("height", "100%");
      myforeign.classList.add("foreign"); 
      textdiv.classList.add("insideforeign"); 
      textdiv.addEventListener("mousedown", elementMousedown, false);
      myforeign.setAttributeNS(null, "transform", "translate(" + localpoint.x + " " + localpoint.y + ")");
      svg.appendChild(myforeign);
      myforeign.appendChild(textdiv);
  
  };
  
  function elementMousedown(evt) {
      alert("elementMousedown");
      mousedownonelement = true;
  }
  </code></pre>
  
  <p>since it is mouse events it works only on desktop so what can be the solution for ipad touch event will this logic works</p>
  
  <pre><code>$('#calloutbox').click(function (evt) {
      var svg = document.getElementById('canvas');
      alert(svg);
      var localpoint = getlocalmousecoord(svg, evt);
      if (!mousedownonelement) {
          createtext(localpoint, svg);
      } else {
          mousedownonelement = false;
      }
  });
  </code></pre>