0% found this document useful (0 votes)
61 views

HTML Calculadora

This document contains the code for building an online calculator. It includes divs for the display, buttons, and rows to organize the buttons. The buttons trigger functions like add_number(), add_operator(), limpar(), and total() to handle number and operator input, clearing, and calculation.

Uploaded by

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

HTML Calculadora

This document contains the code for building an online calculator. It includes divs for the display, buttons, and rows to organize the buttons. The buttons trigger functions like add_number(), add_operator(), limpar(), and total() to handle number and operator input, clearing, and calculation.

Uploaded by

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

<!

-- CALCULATOR -->
<div class="calculator">

<!-- DISPLAY -->


<div class="display">
<input id="display" placeholder="0" disabled>
<h2 id="history"></h2>
</div>

<!-- <BUTTONS -->


<div class="row">
<button class="button purple-text" onclick="limpar()">AC</button>
<div></div>
<div></div>
<button class="button gray" onclick="add_operador('/')">/</button>
</div>

<div class="row">
<button class="button" onclick="add_numero(7)">7</button>
<button class="button" onclick="add_numero(8)">8</button>
<button class="button" onclick="add_numero(9)">9</button>
<button class="button gray" onclick="add_operador('*')">*</button>
</div>

<div class="row">
<button class="button" onclick="add_numero(4)">4</button>
<button class="button" onclick="add_numero(5)">5</button>
<button class="button" onclick="add_numero(6)">6</button>
<button class="button gray" onclick="add_operador('-')">-</button>
</div>

<div class="row">
<button class="button" onclick="add_numero(1)">1</button>
<button class="button" onclick="add_numero(2)">2</button>
<button class="button" onclick="add_numero(3)">3</button>
<button class="button gray" onclick="add_operador('+')">+</button>
</div>

<div class="row">
<div></div>
<button class="button" onclick="add_numero(0)">0</button>
<button class="button" onclick="add_numero('.')">.</button>
<button class="button purple" onclick="total()">=</button>
</div>
<!-- BUTTONS/> -->
</div>

You might also like