Skip to content

deniznida/jQuery-user-input-calculator-ruby-007-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

language tags type resources
JavaScript, js
selectors
lab
4

Code Challenge - jQuery User Input Calculator

Students will work in groups to create a calculator that accepts user input using jQuery event listeners and JavaScript functions, if/else or switch statements, and jQuery val methods.

The calculator should do the following:

  1. Be object oriented.
  2. the calculator should take use jQuery selectors to get the input for 2 separate numbers and 1 operation: '+', '-', '*', '/'.
  3. When the user clicks the equals button, the calculator should update the result h2 tag with the result. 1. If the user leaves a number field blank or inserts some input that is not a number then h2 with id="result" should instead print the error message: "Sorry, one of those is not a valid number!". 2. If the operation inserted is not one of the valid accepted operations then the error message should then read "Sorry, not a valid operation!"

See a live working example of the simple calculator here

##Before You Start

# Install jasmine:
gem sources -a http://flatiron:[email protected]
gem install ironboard

# Run Jasmine test suite:
ironboard  # runs only in the terminal
ironboard -b # runs also in the browser

Resources

US/docs/Web/JavaScript/Reference/Statements/function)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •