jquery toggle between the two divs
<p>I'm new to jQuery and trying to work out how to achieve the following...</p>

<p>I have two div shown below, I want <code>group</code> div to show on load but not <code>single</code> div then onclick of <code>group</code> or <code>single</code> I need toggle between the two. How can this be done. This is what I have so far.</p>

<pre><code>Send to: &lt;a href=""&gt;Group&lt;/a&gt; | &lt;a href=""&gt; Single&lt;&lt;/a&gt;

&lt;div id="group"&gt;I'm a group&lt;/div&gt;
&lt;div id="single"&gt;I'm a single object&lt;/div&gt;
</code></pre>

<p>UPDATE:</p>

<p>So something like this seems to work for me....</p>

<pre><code> $("#link").click(function(e) {
      e.preventDefault();
      $("#divA, #divB").toggle();
      $(this).text(function(i, text) { return (text == "Show viewA") ? "Show viewB" : "Show viewA" });
    });
</code></pre>

<p>but divB does not show.</p>
