lundi 18 avril 2016

How do i take sum by selecting checkbox and values in span and show total in another span

I need to select checkbox and grab the values from span and show the sum in another span having id of amount

 <div class="col1">
          <div class="field">
            <div class="label-wrap">
              <label class="required" for="buy_form_pwd2">Books Required</label>
            </div>
            <div class="input-wrap">
              <input type="checkbox" id="you-are" name="total">Book Name<span style="margin-left:10px;">Price</span><span style="margin-left:10px;">No of Books<input style="width: 45px;" type="number" placeholder="1"></span><span style="margin-left:10px;">250</span><br><hr style="margin:0;">
              <input type="checkbox" id="you-are" name="total">Book Name<span style="margin-left:10px;">Price</span><span style="margin-left:10px;">No of Books<input style="width: 45px;" type="number" placeholder="1"></span><span style="margin-left:10px;">375</span><br><hr style="margin:0;">
              <input type="checkbox" id="you-are" name="total">Book Name<span style="margin-left:10px;">Price</span><span style="margin-left:10px;">No of Books<input style="width: 45px;" type="number" placeholder="1"></span><span style="margin-left:10px;">350</span><br><hr style="margin:0;">
              <input type="checkbox" id="you-are" name="total">Book Name<span style="margin-left:10px;">Price</span><span style="margin-left:10px;">No of Books<input style="width: 45px;" type="number" placeholder="1"></span><span style="margin-left:10px;">200</span><br><hr style="margin:0;">
              <input type="checkbox" id="you-are" name="total">Book Name<span style="margin-left:10px;">Price</span><span style="margin-left:10px;">No of Books<input style="width: 45px;" type="number" placeholder="1"></span><span style="margin-left:10px;">300</span><br><hr style="margin:0;">
              <input type="checkbox" id="you-are" name="total">Book Name<span style="margin-left:10px;">Price</span><span style="margin-left:10px;">No of Books<input style="width: 45px;" type="number" placeholder="1"></span><span style="margin-left:10px;">300</span><br><hr style="margin:0;">
            </div>
          </div>
        </div>
        <div class="extra-col">
          <ul>
            <li><span class="autorization-redirect"><b>Total Amount</b></li><hr>
            <li style="text-align:right;"><span class="autorization-redirect">Rs.</span><span class="autorization-redirect" id="amount"></li>
          </ul>
        </div>




Aucun commentaire:

Enregistrer un commentaire