title: get the previous element value with jquery
body: <p>I have a wordpress page on which products are shown with ajax add to cart action. I want to get the value of input with name=quantity when button is clicked. I want to do this with jquery prev() function as there are many other inputs with same attributes. So how can i do that? I have </p>
  
  <pre><code>jQuery(document).ready(function(e){
       e(document).on("click",".add_to_cart_button",
            function(){
            var t=e(this);   
  })})
  
  
  
  &lt;form action="/shop/?add-to-cart=1732" class="cart" method="post" enctype="multipart/form-data"&gt;
      &lt;div class="quantity buttons_added"&gt;
         &lt;input type="button" value="-" class="minus"&gt;
         &lt;input type="number" step="1" name="quantity" value="1" title="Qty" class="input-text qty text"&gt;
         &lt;input type="button" value="+" class="plus"&gt;
      &lt;/div&gt;
      &lt;button type="submit" data-product_id="1732" data-product_sku="menu-aug-02" data-quantity="1" class="add_to_cart_button button product_type_simple"&gt;Add to cart&lt;/button&gt;&lt;/form&gt;
  </code></pre>