Closed Bug 61104 Opened 25 years ago Closed 25 years ago

getAttributeNode accepts "class" as parameter when it shouldn't

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: ruairif, Assigned: jst)

Details

Forgive me if this is a misreading of the specification (it can be a tad unwieldy) but shouldn't getAttributeNode reject "class" as a parameter since its a reserved name, with "className" the alternative? Again, college proxy prevents me from uploading a test case....
Can you perhaps point me at the specification and the place(s) which lead you to your conclusion? My reading of the DOM2 code spec didn't hint at "class" being a reserved word for getting attribute nodes, but I only read a small portion of it.
Class is a reserved word in many programming languages and that's why the DOM uses the name 'className' and not 'class' for the name of the property that maps to the HTML attribute 'class', this does NOT however mean that getAttribute("className") should work, since the argument given to getAttribute() is a string there's no problem with using words that are reserved in some languages. The argument given to getAttribute() is the exact name of the attribute in HTML and it should not be confused with the name of the properties the DOM defines, there's not always a one-to-one mapping between DOM property names and HTML attribute names. Marking INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
yeah
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.