M. L. Kuhn, Writer/Web Consultant
Top navigation

dot net | dot com | whatever blog

By Michael L. Kuhn, Writer/Web Consultant



Fri Dec 29, 2006

Interesting Cross-Browser Tidbit: Letter Case in ID Names

Posted by: M. L. Kuhn on Dec 29, 06 | 12:58 pm | Profile

If you do a document.getElementById() on an object whose ID has the exact same letters but doesn't match the case of the object's declared ID, it should fail, right? Depends on the browser.

Here's what really happens:

IE 6.0: It works anyway! It appears to make the ID case-insensitive so the access will succeed. Typical of ID, the "forgiving browser".

Firefox 1.0/ Netscape 7.0:
It fails as it should, giving the error "Object has no attributes".

Go figure...


[0] comments (18264 views) |  [361] Trackbacks   [0] Pingbacks

 

 

Servers provided by 

Clients link - web design, development, hosting, maintenance Family - 5Ms - link Fiction link Resume link Portfolio link Blog link Servers by Media Temple (mt) Network of Sites link Home link Servers by Media Temple (mt) Network of Sites link Home link Superheroes of Web Presence Design - Who are these guys?