I have a function which simply changes the class of an element based on a click. It works fine everywhere but IE8. Any assistance would be great!
This is the function:
function attachToggleReportType (elem) {
elem.addEventListener('change', toggleReportType);
}
function toggleReportType () {
var reportOptions = document.querySelectorAll('.report'),
reportIncToggle = document.querySelectorAll('.toggle');
reportSample({
href: this.getAttribute('data-sample-report-link'),
src: this.getAttribute('data-sample-report-image')
});
reportIncToggle.forEach(toggleInclude);
var report_type = $(this).find('input[type=radio]').val();
report_type = ( report_type == 1 ? 'Verified' : 'Claims');
// analytics.updateType(report_type);
}
function toggleInclude (item) {
item.classList.toggle('notIncluded');
item.classList.toggle('included');
}
HTML
<li class="larger toggle notIncluded">
<span>Cross-Canada lien search</span>
<br>
Exclusive to CARPROOF <strong>Verified</strong> reports, we’ll tell you if there’s money owing on the vehicle.
</li>