Closed Bug 688501 Opened 14 years ago Closed 13 years ago

Web Console mistakes variable name for element ID

Categories

(DevTools :: Console, defect)

6 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jeff, Unassigned)

Details

Attachments

(1 file)

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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
not getting a warning anymore.
Status: NEW → RESOLVED
Closed: 13 years ago
Component: Developer Tools → Developer Tools: Console
Resolution: --- → WORKSFORME
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: