Closed
Bug 688501
Opened 14 years ago
Closed 13 years ago
Web Console mistakes variable name for element ID
Categories
(DevTools :: Console, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: jeff, Unassigned)
Details
Attachments
(1 file)
100 bytes,
text/plain
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
Build ID: 20110902133214
Steps to reproduce:
In the Web Console: Let a variable refer to a DOM element whose ID matched the name of the variable, then referred to the variable by name.
> let h = document.getElementById('h');
undefined
Actual results:
Web Console mistakenly assumed that I was trying to access an element by ID, whereas I was actually accessing a variable whose name just matched the element ID. We Console issued a spurious warning:
> h
[object HTMLHeadingElement]
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
Expected results:
No warning should have been issued.
Updated•14 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 1•13 years ago
|
||
not getting a warning anymore.
Status: NEW → RESOLVED
Closed: 13 years ago
Component: Developer Tools → Developer Tools: Console
Resolution: --- → WORKSFORME
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•