title: Changing class to active using JavaScript onClick
body: <p>I've tried my best to figure this out myself but to no avail as I'm new to web development. It's probably really basic but I'd really appreciate some help because I'm going around in circles here..</p>
  
  <p>I have a Google map search form (essentially a store locator) and what I've done for the search results is split into two tabs; a list and a map. </p>
  
  <p>What I would like to do is have the map tab always be the active tab when the submit button is pressed in the search form.</p>
  
  <p>This is the HTML code:</p>
  
  <pre><code>&lt;ul class="nav nav-tabs" id="myTab"&gt;
    &lt;li id="maptab" class="active"&gt;&lt;a href="#resmap"&gt;Map&lt;/a&gt;&lt;/li&gt;
    &lt;li id="listtab" &gt;&lt;a href="#reslist"&gt;List&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;div class="tab-content"&gt;
    &lt;div class="tab-pane active" id="resmap"&gt;
      &lt;div id="map_canvas"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="tab-pane" id="reslist"&gt;
      &lt;div id="results"&gt;
        &lt;ul class="res-list" id="list"&gt;&lt;/ul&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So basically for the map items I'm trying to get the code to return to</p>
  
  <pre><code>div class="tab-pane active"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>li class="active"
  </code></pre>
  
  <p>Presumably I have to add an onclick element to the submit button??</p>
  
  <p>The html for the submit button in the form is</p>
  
  <pre><code>&lt;input type="submit" name="op" id="edit-submit" value="Search" class="btn btn-primary" /&gt;
  </code></pre>