The one thing you can be certain of with regard to this particular bug is that there will be browsers out there that do not have the bug and which therefore will process the code correctly in accordance with the standards. If you define your HTML properly in accordance with the standards then Firefox does not display the buggy behaviour. This means that there are no circumstances where you ought to even consider making use of the bug rather than using getElementById to access the element in the HTML properly - simply because the bug doesn't always work and since it isn't a part of the standards and can cause no end of problems the browsers will hopefully fix it before too long.
Our code to do this is:
// rest of script goes here
Having wrapped our script content like that we no longer care whether 'test' is defined globally or not as we have defined our own variable by that name which we can use for whatever purpose we want to use it for. We can even use it for the same purpose that some browsers have defined that global variable for - to provide access to the element in the HTML with that id simply by using:
test = document.getElementById('test');
This article written by Stephen Chapman, Felgall Pty Ltd.