While troubleshooting a JavaScript issue, I came across what seems to be a bug in Internet Explorer 11. I am reaching out here on StackOverflow for validation and to see if anyone else using IE11 can replicate this problem.
The problem arises when the value of a hidden input contains a HTML entity, triggering an input
event as soon as the page loads.
To see this issue in action, check out this demo:
Here is the source code of the page:
<!doctype html>
<html>
<head>
<script>
document.addEventListener('DOMContentLoaded', function(){
document.getElementById('foo').addEventListener('input', function(){
alert('Crap!');
});
});
</script>
</head>
<body>
When you refresh the page in IE11, you will encounter an alert, whereas other browsers won't trigger any alert.
<form>
<input id="foo" type="hidden" name="utf8" value="✓" />
</form>
</body>
</html>
I need help confirming if this is indeed a browser bug or if there is something wrong with my implementation.