How to replace the input attribute with jquery?
The code below:
<input class="input-radio" data-checkout-total-shipping="$ 25.00" />
I'm using Jquery which gives me a variable "total"
Jquery:
<script>
var total = 0;
$(".product__description__property").each(function(d) {
var value = $(this).text().replace("weight: ", "").replace(" lb", "");
total += +value;
});
document.getElementById('total').textContent = total;
</script>
I want to replace whatever is inside " " of data-checkout-total-shipping="25" with total variable from Jquery script.