title: JS: how to get tbody index in table
body: <p>I have a table with many tbodies inside. For example:</p>
  
  <pre><code>&lt;table id="tableId"&gt;
   &lt;tbody id="tbodyId"&gt;
     &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;
   &lt;/tbody&gt;
   &lt;tbody&gt;
     &lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;
   &lt;/tbody&gt;
   &lt;tbody&gt;
     &lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;
   &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I need these tbody for grouping rows with span. How can I get certain tbody index in table via js? I mean:</p>
  
  <pre><code>var tbody=....;
  var table=....;
  var tbodyIndex=?
  </code></pre>
  
  <p>For example, for rows we can use <code>rowIndex</code>, but for tbodies?</p>
  
  <p><strong>EDIT</strong>
  Special edit for some users:</p>
  
  <pre><code>var tbody=document.getElementById("tbodyId");
  var table=document.getElementById("tableId");
  var tbodyIndex=?
  </code></pre>