#Get variable from a class

4 messages · Page 1 of 1 (latest)

south plank
#

you seem to be accessing .dom_elements in a static way. But it an instance property.

static depot
south plank
#

You can not

#
regions.forEach(region => {
    new RegionOption(region.nom, region.code);
})

this indicates that you are dealing with multiple reagions.
So of which region do you want to retrieve the dom_element? You'd have to first understand what you are trying to do anyway.

More generally:

  1. please add syntax highlighting to your code blocks, see #faq
  2. check the resources in #faq to learn JS
  3. do not mix await and .then. They are different solutions to the same problem. await is preferred nowadays
  4. in JS, it is preferred to use camelCase, not snake_case. But whichever you use, you should at least be consistent (regionSelected vs loaded_regions)