Can't figure out why arithmetic parameters are not being passed
<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Buttons&lt;/title&gt;
&lt;style type="text/css"&gt;

.intro{background-color:;}
.duction{background-color:blue;}
.function{background-color:grey;}
.equals{background-color:orange;}
&lt;/style&gt;





&lt;/head&gt;
&lt;body&gt;
&lt;form name="calculator"&gt;
&lt;input type="text"  name="display" length="50" width="100"&gt;
&lt;div&gt;
&lt;input type= "button" value="7" class="intro" id="7" onclick="one(7)"&gt;&lt;/button&gt;
&lt;input type= "button" value="8" class="intro" id="8" onclick="one(8)"&gt;&lt;/button&gt;
&lt;input type= "button" value="9" class="intro" id="9" onclick="one(9)"&gt;&lt;/button&gt;
&lt;input type= "button" value="+" class="intro" id="+" onclick="one(+)"&gt;&lt;/button&gt;
&lt;input type= "button" value="-" class="intro" id="-" onclick="one(-)"&gt;&lt;/button&gt;
&lt;div&gt;
&lt;input type= "button" value="4" class="intro" id="4" onclick="one(4)"&gt;&lt;/button&gt;
&lt;input type= "button" value="5" class="intro" id="5" onclick="one(5)"&gt;&lt;/button&gt;
&lt;input type= "button" value="6" class="intro" id="6" onclick="one(6)"&gt;&lt;/button&gt;
&lt;input type= "button" value="x" class="intro" id="x" onclick="one(*)"&gt;&lt;/button&gt;
&lt;input type= "button" value="/" class="intro" id="/" onclick="one(/)"&gt;&lt;/button&gt;
&lt;div&gt;
&lt;input type= "button" value="1" class="intro" id="1" onclick="one(1)"&gt;&lt;/button&gt;
&lt;input type= "button" value="2" class="intro" id="2" onclick="one(2)"&gt;&lt;/button&gt;
&lt;input type= "button" value="3" class="intro" id="3" onclick="one(3)"&gt;&lt;/button&gt;
&lt;input type= "button" value="=" class="intro" id="=" onclick="Evaluate()"&gt;&lt;/button&gt;
&lt;div&gt;
&lt;input type= "button" value="0" class="intro" id="0" onclick="one(0)"&gt;&lt;/button&gt;
&lt;input type= "button" value="." class="intro" id="." onclick="one(.)"&gt;&lt;/button&gt;
&lt;input type= "button" value="c" class="intro" onclick="clearDigit()"&gt;&lt;/button&gt;

&lt;script type="text/javascript" src="C:\Users\LS\Desktop\QBJS\button.js"&gt;



&lt;/script&gt;



&lt;/body&gt;
&lt;/html&gt;


var timer;
var object;
var thing;
var digit="";
var result;


function one(event)
{
   clearTimeout(timer);
   timer=setTimeout(function(){AddDigit(event);},200);

}
</code></pre>

<p>in this function I started off using a regEx to check for digits and arithmetic operators being passed into x. Thats when I realized that my arithmetic operators were not being passed at all. I don't know why!!!</p>

<pre><code>function AddDigit(x)
{
   alert(x);
   /*if(/^\d[+-*\/$/.test(x)) 

       {document.calculator.display.value+=x;}
   else 


      */ {document.calculator.display.value+=digit + x;}
}



 function Evaluate()
{
  result=eval(document.calculator.display.value);
  document.calculator.display.value = result;
}



document.ondblclick=function(button)
{
   clearTimeout(timer);

   thing=button.target;

   if(thing.className=="intro")
      {thing.className="duction";}

   else if(thing.className=="duction")
      {thing.className="intro";}    
}



function clearDigit()
{
   document.calculator.display.value="";
}
</code></pre>
