I have a to rewrite code written couple of years ago to work with modern browsers. That site includes couple of Javascript files.
In on of them there is a code something like this - it's generating DOM elements dynamically:
createTabs();
createTabsContent();
Now, I'm opening site in Chrome and after page is loaded I try to change some fresh generated element style by
document.getElementById('element').style.display = 'none';
and it's not working - either form script or Chrome console. Yes, element with id #element exists in DOM). What is wierd - Chrome doesn't reporting any errors.
But, when I modify code and do something like that:
alert('test'); //i put alert here
createTabs();
createTabsContent();
//alert('test'); // or put it here
everything working properly.
In other browsers: IE8, FF, Opera everything works, also no errors. I used jQuery document.ready, then tried with window.onload events - and they failed - nothing changed.
What may cause this behaviour?