title: How to access the inside function of outer function using on click method in JavaScript?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var pick = {};
  
  function pick0() {
    pick.value = document.getElementById('box00').getAttribute('data-value');
  }
  
  function myCheck() {
    function drop() {
      var content = document.getElementById('box');
      content.innerHTML = pick.value;
    }
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#box {
    background-color: #f1f1f1;
    width: 60px;
    text-align: center;
    height: 50px;
    font-size: 30px;
    border: 1px solid black;
  }
  
  #box00 {
    background-color: #f1f1f1;
    width: 60px;
    text-align: center;
    height: 50px;
    font-size: 30px;
    border: 1px solid black;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="box" onclick="drop()"&gt;&lt;/div&gt;
  &lt;br&gt;
  &lt;button type="button" id="button" onclick="myCheck()"&gt;CHECK&lt;/button&gt;
  &lt;br&gt;&lt;br&gt;
  &lt;div id="box00" data-value="0" onclick="pick0()"&gt;0&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>These are my codes. In here I want to copy the value from &quot;Box00&quot; to &quot;Box&quot; after pressed the button. Without pressing the button I don't want to copy the value. I tried many ways but I can't find a way to fix this. I hope you understand my problem. Please help me.</p>