title: I'm want to drop text of canvas.. help me
body: <p>To respected developer. </p>
  
  <p>before write this question, I'm weak english.</p>
  
  <p>I'm studying javascript. </p>
  
  <p>but one problem is work..</p>
  
  <p>I'm want to drop text of canvas.. but.. I'm don't know how drop this text..</p>
  
  <p>how modify this code..?   please help me..</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> &lt;script type="text/javascript"&gt;
  
  
   var Text_array = new Array("exam1", "exam2", "exam3");
   var canvas = document.getElementById("myCanvas");
   var ctx = canvas.getContext("2d");
   ctx.font = "30px Arial";
   for (i = 0; i &lt; 3; i++) {
          ctx.fillText(Text_array[i], 100 * i + 10, 50);
   }
  
  function removeText()
  {
   var removeText = document.getElementById("txtWord").value;
   var position = Text_array.indexOf(removeText);
   if( position  &gt; -1)
   {
    Text_array.splice(position,1);
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    
    for (i = 0; i &lt; Text_array.length; i++) {
            ctx.fillText(Text_array[i], 100 * i + 10, 50);
     }  
   }
  }
   &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;style type="text/css"&gt;
  
      .box {
              position: relative;
              width: 800px;
              height: 600px;
       }
           .box canvas {
                  border: 1px solid red;
           }
           .box .control {
                  position: relative;
                  bottom: 30px;
                  z-index: 999;
                  width: 100%;
                  padding: 5px;
                  border: 1px solid blue;
                  display: inline-block;
           }
              .box .control input {
                      float: left;
                      width: 45%;
               }
               .box .control button {
                      float: right;
                      width: 45%;
                      color: #000;
                     margin-right: 15px;
               }
   &lt;/style&gt;
   &lt;/head&gt;
   &lt;body&gt;
   &lt;div class="box"&gt;
       
       &lt;canvas id="myCanvas" width="800" height="600"&gt;
           Your browser does not support the canvas element.
       &lt;/canvas&gt;
       &lt;div class="control"&gt;
           &lt;input id="txtWord" type="text" name="word" value=""&gt; 
           &lt;button type="button" class="btn" title="" onclick="javascript:removeText();" &gt;Btn&lt;/button&gt;
       &lt;/div&gt;
   &lt;/div&gt;
  
   &lt;/body&gt;
   &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>