title: javascript comparing two values
body: <p>In Js how do I compare two values. i have got three buttons that each generate a number between <code>1</code> and <code>3</code>. </p>
  
  <p>I want to compare the number they output with the  number of the <code>button</code>, for example the first button could be <code>1</code>, the second <code>2</code>, the third <code>3</code>.</p>
  
  <p>If the number generated by the button is the same as 2, it says its a draw.</p>
  
  <pre><code>function Random()
  {
      var result = display.innerHTML = Math.floor((Math.random() * 3) + 1);
  }
  </code></pre>
  
  <p>HTML Code:  </p>
  
  <pre><code>&lt;form&gt;
      &lt;input id="rock"     type="button" onclick="Random()" value="Rock"     /&gt;
      &lt;input id="paper"    type="button" onclick="Random()" value="Paper"    /&gt;
      &lt;input id="scissors" type="button" onclick="Random()" value="Scissors" /&gt;
  &lt;/form&gt;
  </code></pre>