In a simplified scenario, in my HTML I have this:
<body onload="document.getElementsByClassName('default')[0].click()">
<a class="dim default" href="#" onclick="select(this, 'dim', 'shiny')">click it</a>
So, when the page loads, select(this, 'dim', 'shiny') is called. It works in Opera, Firefox, Chrome and Safari, but IE error console says "object doesn't support this property or method".
Now, if I have this:
<body onload="document.getElementById('default').click()">
<a class="dim" id="default" href="#" onclick="select(this, 'dim', 'shiny')">click it</a>
IE doesn't complain. Well, I said "simplified" at the beginning of my question, because I actually have a function that executes on page load and clicks on everything that has "default" listed in it's class. Is there any way I can solve this problem without using IDs?