title: Toggle multiple table rows
body: <p>I got this table, used for menu and submenu items.
  It's a combination of PHP (to read the menu items and per menu item all submenu items) and HTML.</p>
  
  <p>What I need is to find a way to toggle visibility on only the submenu items of main menu item.</p>
  
  <p>I've tried lots of stuff with javascript and jQuery (getelementbyID, byName, byClassname ) but it all doesn't seem to work.. (perhaps it's so simple that I'm making it diffcult..)</p>
  
  <p>What I do is I get the mainmenu item per row in the DB table, ordered by order number.
  While posting the table row with content, I query the submenu DB table for the submenu items.</p>
  
  <p>I post the submenu items as additional normal TR lines, so it's no separate table or anything, just a new TR.</p>
  
  <p>For both while loops, I run a counter so I can use that as a reference number.</p>
  
  <p>I set the display to 'none' on those submenu items, but I'm not sure where to go from there.</p>
  
  <p>ex:</p>
  
  <pre><code>&lt;table&gt;
  
  &lt;!-- column text //--&gt;
  &lt;tr&gt;
      &lt;th&gt;1st var&lt;/th&gt;&lt;th&gt;2nd var&lt;/th&gt;&lt;th&gt;3rd var&lt;/th&gt;
  &lt;/tr&gt;
  
  &lt;!-- mainmenu item //--&gt;
  &lt;tr&gt;
      &lt;td&gt;1st var&lt;/td&gt;&lt;td&gt;2nd var&lt;/td&gt;&lt;td&gt;3rd var&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;!-- submenu item //--&gt;
  &lt;tr&gt;
      &lt;td&gt;1st var&lt;/td&gt;&lt;td&gt;2nd var&lt;/td&gt;&lt;td&gt;3rd var&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;!-- next mainmenu item //--&gt;
  &lt;tr&gt;
      &lt;td&gt;1st var&lt;/td&gt;&lt;td&gt;2nd var&lt;/td&gt;&lt;td&gt;3rd var&lt;/td&gt;
  &lt;/tr&gt;
  
  
  &lt;!-- and so on //--&gt;
  </code></pre>
  
  <p></p>