title: How to show the button on click value?
body: <p>I'm a beginner at programming.</p>
  <p>When I click the button,
  The value of the button...
  I want it to be displayed as input.</p>
  <p>And, when i click it several times,
  The corresponding value is added.
  I want to mark it.</p>
  <p>I'm searching the Internet, but it's not working.
  Please help me. Thank you.</p>
  <pre><code>        &lt;script&gt;
                  $(document).ready(function(){
                  $('#myform input').on('change',function(){
                  var cvalue=$(&quot;[type='button']:onclick&quot;).val();
                  $('#cvalue').val($(&quot;[type='button']:onclick&quot;).val());
                  });
                  });
          &lt;/script&gt;         &lt;div class=&quot;inputdiv&quot;&gt;
                  &lt;input type=&quot;text&quot; id=&quot;cvalue&quot; class=&quot;money&quot;&gt;
          &lt;/div&gt;
                  &lt;button class=&quot;button1&quot; type = &quot;button&quot; value=&quot;100,000&quot;&gt;100,000&lt;/button&gt;
                  &lt;button class=&quot;button1&quot; type = &quot;button&quot; value=&quot;200,000&quot;&gt;200,000&lt;/button&gt;
                  &lt;button class=&quot;button1&quot; type = &quot;button&quot; value=&quot;300,000&quot;&gt;300,000&lt;/button&gt;
                  &lt;button class=&quot;button1&quot; type = &quot;button&quot; value=&quot;500,000&quot;&gt;500,000&lt;/button&gt;
                  &lt;button class=&quot;button1&quot; type = &quot;button&quot; value=&quot;1,000,000&quot;&gt;1,000,000&lt;/button&gt;
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/VCBnp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VCBnp.png" alt="enter image description here" /></a></p>