jQuery .change() is not working
<p>In my html structure, I have plus, minus and an input field. When there is any change in my input field, I want to alert 'change occured'. So, when I change the value in my input box by typing or using the up or down arrows then it is giving me an alert. But I have written some code to change the value of input field when I click on the anchor tags with class plus or minus. So, the value is changing when I use the anchor tags but the change function is not being triggered. And hence not getting any alert. So, can anyone please let me know why change is not working here.</p>

<p><strong>HTML</strong>:</p>

<pre><code>&lt;div class="quantity"&gt;
    &lt;a href="javascript:void(0)" class="minus"&gt;-&lt;/a&gt;
    &lt;input type="number" step="1" name="quantity" value="2" title="Qty" class="input-text qty text" size="4"&gt;
    &lt;a href="javascript:void(0)" class="plus"&gt;+&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p><strong>JQuery:</strong> </p>

<pre><code>$(".plus").click(function() {
    var text = $(this).prev("input");
    var va = parseInt(text.val(), 10) + 1;
    text.attr('value',parseInt(text.val(), 10) + 1);
});

$(".minus").click(function() {
    var text = $(this).next("input");

    if(text.val() &gt; 0){
      var va = parseInt(text.val(), 10) - 1;
      text.attr('value',parseInt(text.val(), 10) - 1);  
    }   
});
</code></pre>

<p><strong>jQuery to detect change of input:</strong></p>

<pre><code>jQuery(document).ready(function($) {
    $(document).on( 'change', '.quantity .qty', function() {

         alert('change occurred');
    });
});
</code></pre>

<p><strong>What I have tried</strong></p>

<p>I have already tried: .trigger('change') and also used keyup and input but nothing helped.</p>