3 inputs : 2 type text and 1 button to display the result
1 result container (p or div)
Time : 5 minutes. Equipment :
1 Text editor
Many browsers with console and development tools to test the script. Preparation steps
1/- Load your favourite template for a page
2/- Display the ingredients with a little CSS
3/- Display a onclick event on the button to call a function which read the to values and return the result.
4/- Write the script which should not be a problem.Multiplication automatically converts strings (read with document.getElementById) to numbers.
Number of servings : More than for or five thousand men with phone