This page tests a bug in Internet Explorer whereby the document.getElementById() function may return an element with a name attribute equal to the id that is specified. This can cause unexpected results.

This script was tested on the following browsers:

Test case:

  <input name="bar" type="text" id="foo" value="foo" />
  <input name="foo" type="text" id="bar" value="bar" />
  This should show an alert box where foo=foo and bar=bar

Reported at 2005-08-29

Noted on