Pages

Pages

Pages

الأحد، 20 فبراير 2011

كود الالة الحاسبة

السلام عليكم 

معنا النهاردة كود جميل وروعة كود الالة الحاسبة 
عايز تفتح روابط المدونة فى صفحة جديدة اضغط هنا  

كود الالة الحاسبة :

<script>
function compute(obj)
{obj.expr.value = eval(obj.expr.value)}
var one = '1'
var two = '2'
var three = '3'
var four = '4'
var five = '5'
var six = '6'
var seven = '7'
var eight = '8'
var nine = '9'
var zero = '0'
var plus = '+'
var minus = '-'
var multiply = '*'
var divide = '/'
var decimal = '.'
function enter(obj, string)
{obj.expr.value += string}
function clear(obj)
{obj.expr.value = ''}
</script>
<p align="center"><font color="#000000" size="3"
face="Verdana, Arial, Helvetica, sans-serif"><strong></strong></font><strong> </strong></p>
<form name="calc">
<div align="center"><center><table border="1"
bgcolor="#FFEAFF">
<tr>
<td colspan="4"><input type="text" size="30"
name="expr" action="compute(this.form)"> </td>
</tr>
<tr>
<td><p align="center"><input type="button"
value=" 7 " onclick="enter(this.form, seven)"> </p>
</td>
<td><p align="center"><input type="button"
value=" 8 " onclick="enter(this.form, eight)"> </p>
</td>
<td><p align="center"><input type="button"
value=" 9 " onclick="enter(this.form, nine)"> </p>
</td>
<td><p align="center"><input type="button"
value=" / " onclick="enter(this.form, divide)"> </p>
</td>
</tr>
<tr>
<td><p align="center"><input type="button"
value=" 4 " onclick="enter(this.form, four)"> </p>
</td>
<td><p align="center"><input type="button"
value=" 5 " onclick="enter(this.form, five)"> </p>
</td>
<td><p align="center"><input type="button"
value=" 6 " onclick="enter(this.form, six)"> </p>
</td>
<td><p align="center"><input type="button"
value=" * " onclick="enter(this.form, multiply)"> </p>
</td>
</tr>
<tr>
<td><p align="center"><input type="button"
value=" 1 " onclick="enter(this.form, one)"> </p>
</td>
<td><p align="center"><input type="button"
value=" 2 " onclick="enter(this.form, two)"> </p>
</td>
<td><p align="center"><input type="button"
value=" 3 " onclick="enter(this.form, three)"> </p>
</td>
<td><p align="center"><input type="button"
value=" - " onclick="enter(this.form, minus)"> </p>
</td>
</tr>
<tr>
<td colspan="2"><p align="center"><input
type="button" value=" 0 "
onclick="enter(this.form, zero)"> </p>
</td>
<td><p align="center"><input type="button"
value=" . " onclick="enter(this.form, decimal)"> </p>
</td>
<td><p align="center"><input type="button"
value=" + " onclick="enter(this.form, plus)"> </p>
</td>
</tr>
<tr>
<td colspan="2"><p align="center"><input
type="button" value=" = "
onclick="compute(this.form)"> </p>
</td>
<td colspan="2"><p align="center"><input type="reset"
value="AC" onclick="clear(this.form)"> </p>
</td>
</tr>
</table>
</center></div>
</form>
<p align="center"> </p>
<p align="center"><a
<p align="center"> </p>
<p> </p>
</body>
</html>




ضع الكود فى منتداك او مدونتك 
حسن مستوى مدونتك اضغط هنا  

 

هناك تعليقان (2):

ارجوا عدم وضع روابط لمواقع او المدونات وشكرا على تعليقك