title: Multiple JavaScript Buttons (Variables)
body: <p>I'm just beginning JavaScript, and I was wondering how to make different buttons do different things. So far, I can make one button do one thing, but how do I make a second button do a different thing? Here's the coding:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function show_prompt()
  {
  var name=prompt("Your Name");
  if (name!=null &amp;&amp; name!="")
    {
    alert("Thanks for clicking " + name + "!");
    window.top.location.replace("http://www.google.com");
    }
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;ul&gt;
  &lt;li&gt;
  &lt;input type="button" onclick="show_prompt()" value="Button One" /&gt;
  &lt;/ul&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>