It seems like there could be a caching issue on your end. To resolve this, try pressing CTRL + F5 to hard refresh the page.
The code is functional from my end.
<!DOCTYPE html>
<html>
<head>
<style>
#backfill-image
{
display:none;
}
</style>
</head>
<body>
<div id="backfill-image"><h2>This is my sample text...</h2></div>
<script>
function isIE() {
ua = navigator.userAgent;
/* MSIE used to detect old browsers and Trident used to newer ones*/
var is_ie = ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1;
return is_ie;
}
/* Display an alert if the browser is IE */
if (isIE()){
document.getElementById("backfill-image").style.display = "block";
}
</script>
</body>
</html>
Result in Internet Explorer 11:
https://i.sstatic.net/ikUgt.png
If the problem persists, try running a test with the provided code to check its functionality.
Edit:
Keep in mind that IE does not support Arrow functions. Consider changing the syntax or transpiling the code using Babel. Reference: babeljs.io For further information, visit: Why doesn't this arrow function work in IE 11?
Additionally, please update us on whether the solutions in other threads resolved the issues for you.