title: How do I "get" the ID for a "clicked" tab in a dijit.layout.tabcontainer?
body: <p>I haven't been able to find a clearly defined solution for this. Most are incomplete snippets.</p>
  
  <p>Here is a simple sample. See the doSomething() comment:</p>
  
  <p>
  </p>
  
  <pre><code>&lt;head&gt;
      &lt;style type="text/css"&gt;
          body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
      &lt;/style&gt;
      &lt;link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css"/&gt;
      &lt;script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"
      djConfig="parseOnLoad: true"&gt;
      &lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          dojo.require("dijit.layout.TabContainer");
          dojo.require("dijit.layout.ContentPane");
  
      function doSomething() {
          //Put code in here that identifies the clicked tab and displays it's id in the below alert
          alert("Hello World!");
      }   
  
      &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body class=" claro "&gt;
      &lt;div id="mainTab" dojoType="dijit.layout.TabContainer" style="width: 400px; height: 100px;" onClick="doSomething();"&gt;
          &lt;div id="tab1" dojoType="dijit.layout.ContentPane" title="My first tab" selected="true"&gt;
              Lorem ipsum and all around...
          &lt;/div&gt;
          &lt;div id="tab2" dojoType="dijit.layout.ContentPane" title="My second tab"&gt;
              Lorem ipsum and all around - second...
          &lt;/div&gt;
          &lt;div id="tab3" dojoType="dijit.layout.ContentPane" title="My last tab"&gt;
              Lorem ipsum and all around - last...
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>