title: How to multiply a variable?
body: <pre><code>&lt;script type = "text/javascript"&gt;
  //Add spaces between menu links
  //Placement: Global Header
  //Coded by Game
  
  var spaces = "2";  //Edit number of spaces between menu links (1,2 or 3)
  
  var a = document.getElementsByTagName("a");
  for (i = 0; i &lt; a.length; i++) {
      if (a[i].parentNode.parentNode.className == "menubg" &amp;&amp; a[i].innerHTML.match(/Home|new topics|help|search|members|calendar|admin|profile|logout|register|login/i)) {
          if (spaces == "1") {
          a[i].innerHTML += "&amp;nbsp;";
          }
          if (spaces == "2") {
          a[i].innerHTML += "&amp;nbsp;&amp;nbsp;";
          }
          if (spaces == "3") {
          a[i].innerHTML += "&amp;nbsp;&amp;nbsp;&amp;nbsp;";
          }
      }   
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>The code above is meant to let the useer add spaces between their menu items. It works fine. But how do I make it to where they can add as many spaces as they would like, instead of limiting them to 3? Maybe somehow they would add their number in the var 'spaces' and the code would multiply &amp;nbsp by that numvber?</p>