Hacker News new | ask | show | jobs
by rev087 4008 days ago
Has been like this for as long as I can remember (at least back to IE6).
1 comments

Yup - in fact there's an old bug that jQuery (in versions < 2, I believe) accounts for where IE would return elements with a name equal to the id you're searching for as the underlying system there was all wonky.

e.g:

    <input name="test">
    <div id="test">

    document.getElementById('test'); // <input> in IE6
I believe this also wound up in some Webkit and Opera releases, perhaps for emulation. Someone more knowledgeable about it all should feel free to correct me if I'm wrong though.

(Edited for code formatting, I don't comment too much these days)