Learn Advanced Array Methods by Building a Statistics Calculator - Step 2

Tell us what’s happening:

I don’t speak English and that is why many times recently I have had trouble understanding the challenges, the truth is I don’t understand this challenge.

Challenge:

To begin, the calculate function needs to find the number that was entered in the #numbers input field. To do this, use a .querySelector to locate the input field and then use the .value property to get the number entered.

Store this in a value variable.

Your code so far

/* file: script.js */

// User Editable Region

const calculate = () => {
   const numbers = document.querySelector('#numbers')
   const value = document.querySelector('.value')
   
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Learn Advanced Array Methods by Building a Statistics Calculator - Step 2

the value property is not an other element, the value property is a property of the element #numbers, to get the value of an element you need to write element.value, in this case element is numbers

the problem is: code must be `document.querySelector(‘xxxxxxx’) the . value
must be outside the ( )
most of novices like me will try to put it inside

2 Likes

Please do not necro old posts

1 Like