title: Adding multiple attributes to Javascript/Jquery
body: <p>I'm currently working on a set of tables and i've gotten them to expand and contract at the click of a button. I'm having problems however to create a button that expands all the tables at the same time. Please see my code.</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;   &lt;!--this first part is easy to implement--&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  $(document).ready(function(){
      $(".toggler").click(function(e){
          e.preventDefault();
          $('.vis'+$(this).attr('vistoggle')).toggle();
      });
  });
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;a href="#" class="toggler" vistoggle="1"&gt;Expand all&lt;/a&gt; &lt;!--vistoggle needs to have values 1 and 2 in it--&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;safeaef&lt;/td&gt;
          &lt;td&gt;asdfaef&lt;/td&gt;
          &lt;td&gt;asfead&lt;/td&gt;
          &lt;td&gt;&lt;a href="#" class="toggler" vistoggle="1"&gt;Expand&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="vis1" style="display:none"&gt;
          &lt;td&gt;asdfae&lt;/td&gt;
          &lt;td&gt;zxcvry&lt;/td&gt;
          &lt;td&gt;rteyertr&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class='vis1' style='display:none'&gt;
          &lt;td&gt;tsersg&lt;/td&gt;
          &lt;td&gt;sdgfs&lt;/td&gt;
          &lt;td&gt;wregssdf&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="vis1" style="display:none"&gt;
          &lt;td&gt;sdfgrs&lt;/td&gt;
          &lt;td&gt;sgdfgsr&lt;/td&gt;
          &lt;td&gt;Cewret&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;cfasdfas&lt;/td&gt;
          &lt;td&gt;1adfaed&lt;/td&gt;
          &lt;td&gt;asdfasdfea&lt;/td&gt;
          &lt;td&gt;&lt;a href="#" class="toggler" vistoggle="2"&gt;Expand&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="vis2" style="display:none"&gt;
          &lt;td&gt;asdfaefas&lt;/td&gt;
          &lt;td&gt;1asdf&lt;/td&gt;
          &lt;td&gt;Cisdfae&lt;/td&gt;
          &lt;td&gt;22fasdew&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="vis2" style="display:none"&gt;
          &lt;td&gt;asdfaef&lt;/td&gt;
          &lt;td&gt;1sefa0&lt;/td&gt;
          &lt;td&gt;Ciasdf 2&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>