Closed Bug 48213 Opened 24 years ago Closed 24 years ago

getAttribute is case sensitive in HTML

Categories

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

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: chanah_stern, Assigned: jst)

Details

(Whiteboard: [nsbeta3+])

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; m17) Gecko/20000807
BuildID:    2000080712



Reproducible: Always
Steps to Reproduce:
1.Create an HTML Element with a user defined attribute that contains a capital
letter
2.create an alert that will show the user the value of the above attribute
3.notice the alert contains an empty string

Expected Results:  should have shown the value of the attribute
*Please note* I installed MileStone 15 and this bug did NOT exist back then.

<!-- the following code demonstrates the problem I am having in both windows NT
and windows 95 -->

<html>
<head>
<script>
function testGetAttributeWithCaps()
{
alert("lower case attribute: " +

document.forms[0].elements["Test_Lower_Element"].getAttribute("lowerattribute"));

    alert("CAPTIAL CASE ATTRIBUTE: " +

document.forms[0].elements["Test_Capital_Element"].getAttribute("Capitalattribute"));



}
</script>

</head>
<body onload=testGetAttributeWithCaps()>
<form>
<!-- doesn't work -->
<input type=select name="Test_Capital_Element" Capitalattribute="doesn't work">
<!-- works -->
<input type=select name="Test_Lower_Element" lowerattribute="worked">

</form>
</body>
</html>
All bugs must have summaries.
Summary: NONE: see HTML inserted below → User defined element attributes not shown in alert box
The problem is that getAttribute() only works in HTML if the attribute name is
given as lowercase (sigh!), thanks for catching this problem!

This is bad, really bad, must have for beta3.
Severity: major → critical
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: correctness, nsbeta3
OS: Windows NT → All
Hardware: PC → All
Summary: User defined element attributes not shown in alert box → getAttribute is case sensitive in HTML
Target Milestone: --- → Future
Not sure why this is futured, given jst's comment that this is a bad 
bug.  Changing milestone to M18 and marking nsbeta3+.
Whiteboard: [nsbeta3+]
Target Milestone: Future → M18
Oops, my bad! Thanks for catching that Nisheeth.
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified with 2000-09-13-09.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.