title: Passing onClick variable to Javascript
body: <p>I'm trying to create a menu bar that will refresh a DIV when a button is clicked. I had earlier success with this when it was only one button but now I want the same affect from ten buttons as well as the original first button.</p>
  
  <p>The func.php file</p>
  
  <pre><code>function loggedin()
  {
  print"
  &lt;div class=\"container\"&gt;
  &lt;div class=\"titlebar\"&gt;
  &lt;/div&gt;
  &lt;div class=\"spacerH\"&gt;
  &lt;/div&gt;
  &lt;div class=\"navbar\"&gt;
       &lt;div class=\"menubuttonsl\"&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsl\"&gt;&lt;a class=\"home_out\" onClick=\"changeContent(1);return false;\" title=\"HomePage\"&gt;&lt;/a&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsl\"&gt;&lt;a class=\"email_out\" onClick=\"changeContent(2);return false;\" title=\"Messages\"&gt;&lt;/a&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsl\"&gt;&lt;a class=\"notify_out\" onClick=\"changeContent(3);return false;\" title=\"Notifications\"&gt;&lt;/a&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsl\"&gt;&lt;a class=\"mine_out\" onClick=\"changeContent(4);return false;\" title=\"My Stuff\"&gt;&lt;/a&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsl\"&gt;&lt;a class=\"comm_out\" onClick=\"changeContent(5);return false;\" title=\"Community\"&gt;&lt;/a&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsl\"&gt;&lt;a class=\"live_out\" onClick=\"changeContent(6);return false;\" title=\"Live Action\"&gt;&lt;/a&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsl\"&gt;&lt;a class=\"hot_out\" onClick=\"changeContent(7);return false;\" title=\"What's Hot\"&gt;&lt;/a&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsr\"&gt;&lt;a class=\"im_out\" onClick=\"changeContent(10);return false;\" title=\"Instant Messanger\"&gt;&lt;/a&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsr\"&gt;&lt;a class=\"upload_out\" onClick=\"changeContent(9);return false;\" title=\"Upload Pics/Vids/Audio\"&gt;&lt;/a&gt;&lt;/div&gt;
       &lt;div class=\"menubuttonsr\"&gt;&lt;a class=\"rate_out\" onClick=\"changeContent(8);return false;\" title=\"Rate Pics\"&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=\"header2\"&gt;&lt;div id=\"myTable\"&gt;";
  print"&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  ";
  
  }
  </code></pre>
  
  <p>The hopeful JavaScript on index.php</p>
  
  <pre><code>&lt;script&gt;
  function changeContent(display)
  {
  document.getElementById('myTable').innerHTML=document.getElementById('showTable').innerHTML;
  }
  &lt;/script&gt;
  &lt;script type="text/html" id="showTable"&gt;
  if (display=='signup') {&lt;?php bottomtable2(); ?&gt;}
  else if (display=='1') {&lt;?php MainPanel(); ?&gt;}
  else if (display=='2') {&lt;?php Messages(); ?&gt;}
  else if (display=='3') {&lt;?php Notifications(); ?&gt;}
  else if (display=='4') {&lt;?php MyStuff(); ?&gt;}
  else if (display=='5') {&lt;?php Community(); ?&gt;}
  else if (display=='6') {&lt;?php LiveAction(); ?&gt;}
  else if (display=='7') {&lt;?php WhatsHot(); ?&gt;}
  else if (display=='8') {&lt;?php RatePics(); ?&gt;}
  else if (display=='9') {&lt;?php Upload(); ?&gt;}
  else if (display=='10') {&lt;?php IMessenger(); ?&gt;}
  &lt;/script&gt;
  </code></pre>
  
  <p>The original JavaScript that work perfectly with only the one case</p>
  
  <pre><code>&lt;script&gt;
  function changeContent()
  {
  document.getElementById('myTable').innerHTML=document.getElementById('showTable').innerHTML;
  }
  &lt;/script&gt;
  &lt;script type="text/html" id="showTable"&gt;
      &lt;?php bottomtable2(); ?&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm not against creating new JavaScript for the ten additions but thought I could tie into the existing and working script. The result is I've totally lost the affect and get no reaction to any of the onClicks tho I do get "} else if (display=='1') {} else if (display=='2') {} else if (display=='3') {} else if (display=='4') {} else if (display=='5') {} else if (display=='6') {} else if (display=='7') {} else if (display=='8') {} else if (display=='9') {} else if (display=='10') {}" printed at the top of my page for some reason. What am I missing?</p>