title: Add next pressed button value to input javascript
body: <p>this is my first question here.</p>
  
  <p>I'm a newbie on programming and i'm trying to code a simple calculator in javascript.</p>
  
  <p>Here's my problem: i can add the value of the button to my calculator display, but can't add the next button value to it.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>function addToDisplay(x) {
    $('#display').val(x);
    $('#display').add(x);
          if (x === 'c') {
      $('#display').val('');
    }
  };
  </code></pre>