You're using lambda style for anonymous functions, thats a Javascript ES6 feature.
IE jscript just supports ES5 so you cannot use lambda.
Change from
(whatever)=>{...} to
function(whatever) {} in order to fix it. also const, let etc...
IE is very good browser and very capable, but it has a lot of quircks, for example, always put this on your <head>
This will make IE to use the most advanced possible engine, and will solve many scripting problems.
If you have trouble executing scripts on IE, you can pass the script on
"jsbabel" that will convert your vaid code to ES5 compatible code that will play nicely on IE.
Your code fixed:
var input = document.querySelector('input');
var counter = document.querySelector('.counter');
var counterContent = Number(counter.textContent);
input.addEventListener('keyup', function () {
counter.innerHTML = counterContent - input.value.length;
if (counter.innerHTML < 0) {
counter.style.color = 'red';
} else {
counter.style.color = 'black';
}
});