title: Get value of editable <td> tags through onchange function?
body: <p>I am trying to get the value of  tag which is set editable, in Javascript. code given below</p>
  
  <pre><code>&lt;td class="cent" contenteditable='true' id="value_per_visit" 
  onchange="myFunction()"&gt; -- &lt;/td&gt;
  </code></pre>
  
  <p>Here is my javascript code</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function myFunction() {
    var x = document.getElementById("value_per_visit").value;
    document.getElementById("value_per_visit").innerHTML ="gotit";
    alert("asad");
  }
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>But i am not able to reach the function. Is there any solution?</p>