title: fabric.js adding multiple text using button click
body: <p>I want to add multiple text on  my canvas using click of a button but as i click the button again it reload s the canvas and as loaded my first text again here is my code....is there any better way to do it.???</p>
  
  <pre><code>function text()
  {
  
  var m,n;
  m=150;
  n=60;
  var tex=document.getElementById("tex");
  var tex1=document.getElementById("tex1");
  
  
  var te=tex.value;
  var te1=tex1.value;
  
  
  
  var canvas=new fabric.Canvas('can');    
  
  var text=new fabric.Text( te ,{
  
  top: m,
  left: n
  
  });
  
  canvas.add(text);
  }
  
  function text2()
  {
  
  var m,n;
  m=150;
  n=60;
  
  var tex1=document.getElementById("tex1");
  
  
  
  var te1=tex1.value;
  
  
  
  var canvas=new fabric.Canvas('can');    
  
  
  var text1=new fabric.Text( te1 ,{
  
  top: m,
  left: n
  
  });
  canvas.add(text1);
  }
  </code></pre>