--- id: 5ddb965c65d27e1512d44d9c title: Step 3 challengeType: 0 dashedName: step-3 --- # --description-- Now we need to specify what should be done with the form when the user submits it by clicking the Calculate button. Forms have an `onsubmit` event that can execute a function when the form is submitted. For example, in `document.getElementById('my-form').onsubmit = processForm;`, the function `processForm` will run when the form is submitted. Assign a function named `calculate` to the `onsubmit` event of your form. You will create the `calculate` function later. # --hints-- See description above for instructions. ```js assert( code .replace(/\s/g, '') .match( /document\.getElementById\([\'\"\`]calorie\-form[\'\"\`]\)\.onsubmit\=calculate/ ) ); ``` # --seed-- ## --before-user-code-- ```html

Calorie Counter

Sex
Breakfast
Lunch
Dinner
``` ## --after-user-code-- ```html ``` ## --seed-contents-- ```html ``` # --solutions-- ```html ```