title: jQuery - How can I from a pop up change a different input values
body: <p>How can I change the input value through a pop up.</p>
  
  <p>Let's say I'm building a shopping platform and when the user clicks on the quantity a popup appears. The quantity will be diferent for other products. Here is my code</p>
  
  <p>HTML:</p>
  
  <pre><code>    &lt;form action=""&gt;
          &lt;input class="qnt" type="text" placeholder="Escolha a quantidade"&gt;
          &lt;input class="qnt" type="text" placeholder="Escolha a quantidade"&gt;
          &lt;input class="qnt" type="text" placeholder="Escolha a quantidade"&gt;
          &lt;input class="qnt" type="text" placeholder="Escolha a quantidade"&gt;
      &lt;/form&gt;
  
      &lt;div class="pop_up"&gt;
          &lt;div class="pop_up_container"&gt;
              &lt;input class="pop_up_campo" type="text"&gt;
              &lt;button class="pop_up_confirm"&gt;Confirmar!&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>var qnt = $('.qnt');
  
  $(document).ready(function() {
      $('.pop_up').hide();
  })
  
  qnt.click(function() {
      $('.pop_up').show('fast');
      $('.pop_up_campo').click(function() {
          $('.pop_up_confirm').click(function() {
              $(this).val(qnt.val($('.pop_up_campo').val()));
              $('.pop_up').hide();
          })
      })
  });
  </code></pre>