title: How to combine Selected price and input checkbox price Jquery?
body: <p>i have a checkout form . where there are 2 fields are used o give total amount of checkout  . 1 field is in select tag and second is input type check box i want when i select and option and checkbox there values should be combine to give total.</p>
  
  <pre class="lang-js prettyprint-override"><code>$(function() {
    $('.price-input').change(function() {
      var price = 0;
      $('.price-input').each(function() {
        if ($(this).is(":checked")) {
          price += parseInt($(this).attr("value"), 10);
        }
      })
      $("select.price").change(function() {
        var selectedPrice = $(this).children("option:selected").val();
        document.getElementById("totalPrice").innerHTML = selectedPrice;
      });
      $(".totalPrice").text(price);
    });
  })
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="col-md-6"&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="exampleFormControlSelect1"&gt;@lang('Number of Words'):&lt;/label&gt;
      &lt;select class="price" name="word_prices_id" required&gt;
        &lt;option value=""&gt;@lang('Select Words')&lt;/option&gt;
        @foreach($wordPrice as $wPrice)
        &lt;option value="{{$wPrice-&gt;id}}"&gt;{{$wPrice-&gt;page_quantity}} words&lt;/option&gt;
        @endforeach
      &lt;/select&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;input class="price-input" type="checkbox" name="upsell" value="12"&gt;
  </code></pre>