JS an event after all the html is loaded
<p>I want to make something like library in JS. If table has a class="aClass" I want to automatically modify some of it's elements using JS.</p>

<p>I tried this way:</p>

<pre><code>window.onLoad = LoadSetup();

function LoadSetup()
{
  tables = document.getElementsByTagName("table");
  alert(tables.length);  // it's 0 though there are is one in the document
}
</code></pre>

<p>But i seems that this function runs before loading html. How to fix this?</p>
