diff --git a/components/Dropdown/Dropdown.js b/components/Dropdown/Dropdown.js index c6cad4454..9d436b62f 100644 --- a/components/Dropdown/Dropdown.js +++ b/components/Dropdown/Dropdown.js @@ -2,17 +2,17 @@ class Dropdown { constructor(element) { // Assign this.element to the dropdown element - this.element; + this.element = element; // Get the element with the ".dropdown-button" class found in the dropdown element (look at the HTML for context) - this.button = this.element.querySelector(); + this.button = this.element.querySelector(".dropdown-button"); // assign the reference to the ".dropdown-content" class found in the dropdown element - this.content; + this.content = this.dropdown.querySelector(".dropdownContent"); // Add a click handler to the button reference and call the toggleContent method. - this.button.addEventListener('click', () => { - + this.button.addEventListener('click', ()) => { + this.toggleContent(); }) }