title: DIV switch with active link and URL parameter
body: <p>I’m trying to do div switch from URL parameter with active link. Six <code>&lt;div&gt;</code>s, six links; could be more, could be less.</p>
  
  <p>I would like URL Parameters loading with active link switch, e.g. <code>page.html?option=c2</code>.<br>
  At the moment, loading correct content with URL parameter but without active link, <code>onclick</code> active thereafter working.</p>
  
  <p>Opera having problems I think with wrap div.</p>
  
  <p>Here’s my code so far:</p>
  
  <pre><code>$(window).load(function(){
      var option = 'c1';
      var url = window.location.href;
      option = url.match(/option=(.*)/)[1];
      showDiv(option);    
  
      function showDiv(option) {
       $('#' + option).show();
      }   
  $('#con1b a').click(
      function() {
      var showThis = $(this).attr('name');
      $('.active').removeClass('active');
      $(this).addClass('active');
      $('#wrap &gt; div').hide();
      $('#' + showThis).show();
      return false;
      }); 
  });
  </code></pre>
  
  <p>CSS is this</p>
  
  <pre><code>#con1b a.active {color:#ff3300; text-decoration: none;}
  #wrap div {display: none;}
  </code></pre>
  
  <p>HTML is this</p>
  
  <pre><code>&lt;div id="con1b"&gt;
  &lt;a href="javascript:showDiv('c1')" name="c1"&gt;Link C1&lt;/a&gt;
  &lt;a href="javascript:showDiv('c2')" name="c2"&gt;Link C2&lt;/a&gt;
  &lt;a href="javascript:showDiv('c3')" name="c3"&gt;Link C3&lt;/a&gt;
  &lt;a href="javascript:showDiv('c4')" name="c4"&gt;Link C4&lt;/a&gt;
  &lt;a href="javascript:showDiv('c5')" name="c5"&gt;Link C5&lt;/a&gt;
  &lt;a href="javascript:showDiv('c6')" name="c6"&gt;Link C6&lt;/a&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;div id="wrap"&gt;
      &lt;div id="c1"&gt;C1 Content&lt;/div&gt;
      &lt;div id="c2"&gt;C2 Content&lt;/div&gt;
      &lt;div id="c3"&gt;C3 Content&lt;/div&gt;
      &lt;div id="c4"&gt;C4 Content&lt;/div&gt;
      &lt;div id="c5"&gt;C5 Content&lt;/div&gt;
      &lt;div id="c6"&gt;C6 Content&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Example at
  <a href="http://www.zest.ch/csi/2013/page.html?option=c2" rel="nofollow">http://www.zest.ch/csi/2013/page.html?option=c2</a>
  Loads correct content for div without link as active (red).</p>