# Learn Form Validation by Building a Calorie Counter - Step 90

**URL:** <https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-90/668239>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [January 29, 2024, 6:36pm UTC](https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-90/668239 "2024-01-29T18:36:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranjani.y.iyer](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ranjani.y.iyer/32/419375_2.png) [@ranjani.y.iyer](https://forum.freecodecamp.org/u/ranjani.y.iyer)\
**Post date:** [January 29, 2024, 6:36pm UTC](https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-90/668239/1 "2024-01-29T18:36:08Z")

</div>

### Tell us what’s happening:

I keep getting this message: Your `for` loop should iterate through the `inputContainers` array. Remember to use `i` as your iterator.  
Help

### Your code so far

function clearForm() {  
let inputContainers = Array.from(document.querySelectorAll(‘.input-container’));  
for(let i = 0; i \< inputContainers.length + 1; i++){  
inputContainers[i].innerHTML = “”  
}

}

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

```plaintext
function clearForm() {
  let inputContainers = Array.from(document.querySelectorAll('.input-container'));
  for(let i = 0; i < inputContainers.length + 1; i++){
    inputContainers[i].innerHTML = ""
  }

}

```

### Your browser information:

User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0`

### Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 90

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-form-validation-by-building-a-calorie-counter/step-90)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![ambradnum](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ambradnum/32/241667_2.png) [@ambradnum](https://forum.freecodecamp.org/u/ambradnum)\
**Post date:** [January 29, 2024, 6:43pm UTC](https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-90/668239/2 "2024-01-29T18:43:03Z")

</div>

> [@ranjani.y.iyer](#):
>
> for(let i = 0; i \< inputContainers.length + 1; i++){

Why are you adding 1 to the length? If you start from `index 0` where will you end up?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [July 30, 2024, 6:43am UTC](https://forum.freecodecamp.org/t/learn-form-validation-by-building-a-calorie-counter-step-90/668239/3 "2024-07-30T06:43:28Z")

</div>

Closed on July 30, 2024, 6:43am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
