Jquery : find text field value on click : I have to find the value of qty when I click on the plus or minus icon. following is my code for php 

   

   

     <div class='col-md-2 col-xs-2'>
        	 <img src='<?=base_url()?>assets/img/Plus.png' class='img-responsive carticons pull-right '>
        	 </div>
        	  <div class="col-md-4 col-xs-6">
                <div class="form-group" style="padding-top: 5px;">
               <input type="number" value="<?=$qty?>" class="qty pull-right" min="<?=$qty?> "name="qty" >
       
       </div>
          <div class='col-md-2 col-xs-2' style='padding-left:0; '>
        	<img src='<?=base_url()?>assets/img/Minus.png' class='img-responsive carticons pull-left'>
        	 </div>
             <input type='hidden' data-qty='<?=$qty;?>' class='minqty' value='<?=$value->qty;?>' />


**JQuery code**

  

     $('.carticons').on('click',function(){
     		var quantity = $(this).find('input[name=qty]').val();
    		alert(quantity);
    	})

But in alert it gives me undefined in the alert . 

please help me how can i find this 