How can I transform this code written in JQuery to just JS?
Original code:
$('.abcClass').each(function () {
$(this).html($(this).text().replace(/([^\x00-\x80]|\w)/g, "<span class='mail'>$&</span>"));
});
I've tried to write it like this:
document.querySelectorAll('.abcClass').forEach(function (comment) {
comment.innerHTML(comment.toString().replace(/([^\x00-\x80]|\w)/g, "<span class='mail'>$&</span>"));
});
But I've received the errors:
Uncaught TypeError: comment.innerHTML is not a function
Uncaught TypeError: Cannot read property 'classList' of null
I'm new to jQuery so I found myself pretty much stuck at this step... any help would be appreciated! :)