Open Tab on Page Load - Javascript
<p>I've 3 tabs that use javascript to show content when they are clicked:</p>

<pre><code>&lt;ul class="tab"&gt;
  &lt;li&gt;&lt;a href="#" class="tablinks" onclick="openCity(event, '12_Weeks')"&gt;12 Weeks&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#" class="tablinks" onclick="openCity(event, '4_Weeks')"&gt;4 Weeks&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#" class="tablinks" onclick="openCity(event, '1_Week')"&gt;1 Week&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>Divs are placed in my html code as follows:</p>

<pre><code>&lt;div id="12_Weeks" class="tabcontent"&gt; &lt;!-- Tab 1 starts here --&gt;
&lt;h1&gt;Example Text&lt;/h1&gt;
&lt;/div&gt;
</code></pre>

<p>I'd like the first tab to be open when the page is loaded and have tried the following code:</p>

<pre><code>$( document ).ready(function() {
  // Handler for .ready() called.
  $("#12_Weeks").trigger('click');
});
</code></pre>

<p>however this doesn't seem to do the trick, anyone know what I'm doing wrong here, am sure it's super simple!?</p>