[Bug 25704] "When an element's id attribute is removed, unse..."

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25704

spiritRKS1910 <crimsteam@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crimsteam@gmail.com

--- Comment #1 from spiritRKS1910 <crimsteam@gmail.com> ---
Set to empty string not removed id attribute.

<script type = "text/javascript">

 var el = document.createElement("div");

 alert(el.getAttribute("id"));
 alert(el.id);
 alert(el.hasAttribute("id")); // false

 el.id = "test";

 alert(el.getAttribute("id"));
 alert(el.id);
 alert(el.hasAttribute("id")); // true

 el.id = "";

 alert(el.getAttribute("id"));
 alert(el.id);
 alert(el.hasAttribute("id")); // true

</script>

But this looks strange:
"Either when an element is created that has an id attribute whose value is not
the empty string or when an element's id attribute is set to a value other than
the empty string, set the element's ID to the new value."

<script type = "text/javascript">

 var el = document.createElement("div");

 alert(el.getAttribute("id"));
 alert(el.id);
 alert(el.hasAttribute("id")); // false

 el.id = "";
 el.setAttribute("id", "");

 alert(el.getAttribute("id"));
 alert(el.id);
 alert(el.hasAttribute("id")); // true

</script>

Or maybe create/remove has some other meaning?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 14 May 2014 09:55:33 UTC