title: How to pass a value for input type="number" to JS in Razor View
body: <p>I have a view, here's a fragment of it:</p>
  
  <pre class="lang-html prettyprint-override"><code>@foreach (var item in Model.Items.ToList())
  {
      &lt;tr&gt;
          &lt;td&gt;
              &lt;input type="checkbox" name="productIdCheckbox" value="@item.sLabel"&gt;
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.sLabel)    
          &lt;/td&gt;
          &lt;td&gt;    
              @Html.DisplayFor(modelItem =&gt; item.Text)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.OEMCode)
          &lt;/td&gt;
          &lt;td&gt;
              &lt;input type="number" name="qty" id="qty" min="1" max="1000" step="1" value="@item.Quantity" /&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;input type="submit" data-url='@Url.Action("AddToCart", "Cart", new { id = item.Id, qty = // I DON'T KNOW HOW TO PASS IT HERE // })' class="addProductToCartBtn btn btn-success" value="Add to cart" /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  </code></pre>
  
  <p>This code invoke AddToCart method in CartController:</p>
  
  <pre><code>$('.addProductToCartBtn').click(function (event) {
      var url = $(this).data('url');
      $.ajax({
          url: url,
          type: 'GET',
          success: function (resultFrom_CartSummaryLine) {
              // some logic here..
          }
      });
  });
  </code></pre>
  
  <p>But I can't pass to this method the value for qty input. How can I do it?</p>
  
  <p>To be clear this is a method from CartController in which I want to pass a value for qty parameter:</p>
  
  <pre><code>public PartialViewResult AddToCart(CartModel cart, int id, int qty)
  {
      GetItemListProcedure_Result item = _itemRepository.GetItemByItemId(id).FirstOrDefault();
      if (item != null)
      {
          cart.AddItem(item, qty);
      }
      return PartialView("_CartSummaryLine", cart);
  }
  </code></pre>