I don't usually write in javascript and have wrote myself into a bit of a problem. I wrote the following bit of code to interact with some online donation software so that when someone clicks on a donation amount button (.amountNum input[type='radio']) on a donation page, it prints how much the total donation will be if they cover the processing fee. Which worked... in every browser except internet explorer. Turned out arrow functions don't work in IE, and I don't know how to rewrite the function without it. Any pointers?
var inputs = document.querySelectorAll(".amountNum input[type='radio']");
inputs.forEach(el =>
el.addEventListener('click', function() {
var value = parseInt(this.value, 10);
var URL = `https://example.com/display-fee?contribution=${value}&max=2500.00`;
jQuery.get(URL, function(data) {
var fee = data.fee;
var total = fee + value;
total = total.toFixed(2);
$("#full-gift-label")[0].innerText = ("I'd like to help cover the transaction fees on my donation. My grand total will be £" + total);
})
}));