0% found this document useful (0 votes)
23 views2 pages

Index

Uploaded by

Chahine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Index

Uploaded by

Chahine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

<html>

<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script lang="javascript" src="main.js"></script>
<h1>Calculatrice</h1>
<textarea name="" id="resultat" cols="30" rows="10"></textarea>
<button class="b1" value="c" onclick="effacer()">C</button>
<table>
<tr>
<td><button value="7" onclick="ajouter('7')">7</button></td>
<td><button value="8" onclick="ajouter('8')">8</button></td>
<td><button value="9" onclick="ajouter('9')">9</button></td>
<td><button value="/" onclick="ajouter('/')">/</button></td>
</tr>
<tr>
<td><button value="4" onclick="ajouter('4')">4</button></td>
<td><button value="5" onclick="ajouter('5')">5</button></td>
<td><button value="6" onclick="ajouter('6')">6</button></td>
<td><button value="*" onclick="ajouter('*')">*</button></td>
</tr>
<tr>
<td><button value="1" onclick="ajouter('1')">1</button></td>
<td><button value="2" onclick="ajouter('2')">2</button></td>
<td><button value="3" onclick="ajouter('3')">3</button></td>
<td><button value="-" onclick="ajouter('-')">-</button></td>
</tr>
<tr>
<td><button value="0" onclick="ajouter('0')">0</button></td>
<td><button value="," onclick="ajouter(',')">,</button></td>
<td><button value="=" onclick="calculer()">=</button></td>
<td><button value="+" onclick="ajouter('+')">+</button></td>
</tr>
</table>
</body>
</html>

function ajouter(c) {
document.getElementById("resultat").value += c
}

textarea {
height: 25px;
width: 22%;
background-color: hotpink;
}

button {
border-radius: 25px;
color: chartreuse;
width: 90px;
background-color: darkblue;
height: 60px;
}

td button:hover {
background-color: brown;
}

h1 {
color: darkmagenta;
}

.b1 {
background-color: darkslateblue;
width: 75px;
}

.b1:hover {
background-color: darkturquoise;
}

body {
background-color: gray;
}

You might also like