JavaScript Internet Explorer 11 erroneously triggers “input” event immediately

I was debugging a strange JavaScript issue, and noticed what I think might be a browser bug in IE11. I'm posting here on StackOverflow as a sanity-check -- and maybe to make sure that someone else with IE11 can reproduce this.

The issue is that when a hidden input's value contains a HTML entity, an input event is triggered on the element immediately on page load.

Take a look at this isolated reproduction here: http://dobt-misc.s3.amazonaws.com/ie_11_bug.html

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>
  In IE11, refresh the page. You will see an alert, whereas in other browsers, you will not see an alert.

  <form>
    <input id="foo" type="hidden" name="utf8" value="&#x2713;" />
  </form>
</body>
</html>

Can someone help me confirm whether or not this is a browser bug? Or maybe I'm doing something wrong?

Answer:1

I do not understand the error that I am seeing, nor what I should change in my ESLint configurations to fix it, after digging around for a while. I have a snippet of JS code using ECMA Version 6 (ES6)...

I do not understand the error that I am seeing, nor what I should change in my ESLint configurations to fix it, after digging around for a while. I have a snippet of JS code using ECMA Version 6 (ES6)...

  1. donald trump
  2. donovan mitchell
  3. donald trump twitter
  4. don toliver
  5. donuts
  6. donald trump age
  7. donatos
  8. donald glover
  9. donald trump net worth
  10. donuts near me
  11. donald trump jr
  12. donepezil
  13. don johnson
  14. donald trump speech today
  15. donna shalala
  16. donna summer
  17. donald cerrone
  18. don julio
  19. donnie darko
  20. don quixote

Here m using angular to populate data in my view.. this is just a sample.. on clicking on the particular ageGroupCategory i need to add data into a form and then i want to save the entire data ...

Here m using angular to populate data in my view.. this is just a sample.. on clicking on the particular ageGroupCategory i need to add data into a form and then i want to save the entire data ...

  1. jquery fetch node

how to sort the name in array list by alphabet in javascript, I tried with this code const sample = [ { name: "AddMain", mesg: "test000" }, { name: "Ballside", ...

how to sort the name in array list by alphabet in javascript, I tried with this code const sample = [ { name: "AddMain", mesg: "test000" }, { name: "Ballside", ...

I want left margin of every element in a class to have 70px left margin more than the last one. i.e. marginLeft += 70px; Here's what I have tried: function MarginLeftFunc() { var ...

I want left margin of every element in a class to have 70px left margin more than the last one. i.e. marginLeft += 70px; Here's what I have tried: function MarginLeftFunc() { var ...