cgoodman Posted March 12, 2014 Share Posted March 12, 2014 What I really want is a javascript code that would allow the user to input three numbers. The difference of the first two numbers would be multiplied by the third number and a result output.50 - 2 x 3 = 144 What would that cost? Link to comment Share on other sites More sharing options...
ShadowMage Posted March 12, 2014 Share Posted March 12, 2014 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 More sharing options...
thescientist Posted March 12, 2014 Share Posted March 12, 2014 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 More sharing options...
davej Posted March 12, 2014 Share Posted March 12, 2014 $4.98 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now