Removing attribute node ID affects CLASS too

Confirmed Issue #16878726 • Assigned to Jose L.

Details

Author
Andrea G.
Created
Apr 11, 2018
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
16.16299
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

If an element has an ID as attribute and this is removed as attribute node, the CLASS attribute gets indirectly affected through an empty value nobody asked for.

Custom, or other attributes, don’t seem to be affected.

You can either test this Code Pen or try the following example page.

<!doctype html>
<html>
  <head>
    <script>
    this.onload = function () {
      var div = document.querySelector('div');
      console.log(div.outerHTML);
      // <div class="class" id="id" wut="wat">WUT</div>
      div.removeAttributeNode(div.getAttributeNode('id'));
      console.log(div.outerHTML);
      // <div wut="wat">WUT</div>
      console.log(div);
      // <div class="" wut="wat">WUT</div>
    };
    </script>
  </head>
  <body><div class="class" id="id" wut="wat">WUT</div></body>
</html>

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

      Changed Steps to Reproduce

      Changed Assigned To to “Travis L.”

      Changed Assigned To from “Travis L.” to “Jose L.”

      Changed Status to “Confirmed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in