D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
mattborn
Full window
Github gist
Vanilla JS Calculator
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Vanilla JS Calculator</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="styles.css"> </head> <body> <div class="calculator"> <div class="output">0</div> <div class="button">C</div> <div class="button">±</div> <div class="button">%</div> <div class="button accent">÷</div> <div class="button">7</div> <div class="button">8</div> <div class="button">9</div> <div class="button accent">×</div> <div class="button">4</div> <div class="button">5</div> <div class="button">6</div> <div class="button accent">−</div> <div class="button">1</div> <div class="button">2</div> <div class="button">3</div> <div class="button accent">+</div> <div class="button double">0</div> <div class="button">.</div> <div class="button submit">=</div> </div> <script src="calculator.js"></script> </body> </html>