Need "add to cart" button price to update with correct amount depending on what checkbox is checked

Here is my html for the one-time price

    <label for="autodeliver_off_radio_{{}}" id="auto_deliver_label">
        <input type="radio" name="autodeliver_{{}}" class="autodeliver {{}}" value="onetime" {% if subscription_only == 'false' %} checked="" {% endif %} id="autodeliver_off_radio_{{}}"> <span class="label_background"></span>
        <span style="color:black;">ONE-TIME PURCHASE </span> <span id="one-time-price_{{}}"></span>
        <span class="one_time_product_price"> {{ product.price | money }}</span>

here is my code for the subscription price

    <label for="autodeliver_on_radio_{{}}" id="auto_deliver_label" style="font-weight:bold;">
          <hr style="margin-top:-5px;border-top: 1px solid #000;">
          <input type="radio" name="autodeliver_{{}}" class="autodeliver {{}}" value="autodeliver" {% if subscription_only == 'true' %} checked="" {% endif %} id="autodeliver_on_radio_{{}}"><span class="label_background"></span>
          <span style="color:black;"> SUBSCRIBE 
          {% if discount_percentage != 0 %}
            AND SAVE</span> 
          <span>{{discount_percentage}}%</span> <span id='recurring-time-price_{{}}'></span><br><span class="subscribe_product_price">{{product.price | divided_by: new_num_2 | money }}</span> {% endif %}

and here is where is need the price to update

       <div class="add-to-cart__wrapper">
          <button type="submit" name="add" id="AddToCart" class="btn btn--large btn--full btn--clear uppercase">
            <span id="AddToCartText">{{ 'products.product.add_to_cart' | t }} </span>
            <span class="unicode">&#x2022</span>
            <span class="add-to-cart__price money"><span id="ButtonPrice">{{ product.price | money }}</span></span>

I was hoping there was an easy jquery solution for this but i cant seem to get it. Been trying to extract html value from beside the checkboxes and update the add to cart button but no luck. Really stumped and thanks in advance! I added a visual in case this was confusingenter image description here


Give this jQuery code a try:

    var buttonPrice = $('span#ButtonPrice');

        _this = $(this);

        if ( _this.attr('value') === 'onetime' ) {
            buttonPrice.html( $('span.one_time_product_price').html() );
        } else if ( _this.attr('value') === 'autodeliver' ) {
            buttonPrice.html( $('span.subscribe_product_price').html() );
js interview questions