Skip to content

Instantly share code, notes, and snippets.

@susanBuck
Created April 11, 2014 06:58
Show Gist options
  • Save susanBuck/10445342 to your computer and use it in GitHub Desktop.
Save susanBuck/10445342 to your computer and use it in GitHub Desktop.
Calculator planning session
1. Build calculator
#wrapper
#display / #header / #output
.buttons
2. CSS Style to look like a calc.
3. JS
a. click listeners for the buttons
b. what # was clicked? Store in a variable
c. Put that number in the #display
.append();
d. logic each time
is it a number?
append to the display
otherwise is it a equal sign?
20 + current display = our final result…display .html()
otherwise is it a plus sign?
next time clear the display…
var running_total
<input type=‘hidden’>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment