Jump to content

Javascript subtract and multiply with one click


cgoodman

Recommended Posts

What would it cost? What do you mean what would it cost?

 

 

What you're trying to do is pretty simple stuff. Just get the value of each text box and perform the needed operations. Look up getElementById and the value property.

Link to comment
Share on other sites

You could probably do it in a day if you read a few tuts here on w3schools.

 

Simply, you would three input boxes, a button, and an "output" element, and then one javascript function to

* get the values from each input (look up getting values from input elements)

* parseInt each one (look up the parseInt function)

* do the math (look up operators)

* output the results somewhere on the page (look up setting the innerHTML of an element)

 

when the button is clicked (look up event handling)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...