title: why event.target.value is undefined in javascript?
body: <p>I wrote a function as follow</p>
  
  <pre><code>var getVal = function(event){
     var amount = event.target.value;
     console.log(amount);
   }
  </code></pre>
  
  <p>Dom</p>
  
  <pre><code>&lt;input id='myInp' type='text' onclick='getVal()'/&gt;
  </code></pre>
  
  <p>Sometimes I can get the value just 1 click but sometimes I have to click several times to trigger the event.... Can any one tell me why? This happened on my React.JS application and my ReactNative project as well. Try a lot of time but useless at all...</p>
  
  <p>Many thanks</p>