--- id: 5ddb965c65d27e1512d44d9c title: Part 03 challengeType: 0 isBeta: true --- ## 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.
## Instructions
## Tests
```yml tests: - text: See description above for instructions. testString: assert( code.replace(/\s/g, '').match(/document\.getElementById\([\'\"\`]calorie\-form[\'\"\`]\)\.onsubmit\=calculate/) ); ```
## Challenge Seed
```html ```
### Before Test
```html

Calorie Counter

Sex
Breakfast
Lunch
Dinner
```
### After Test
```html ```
## Solution
```html ```