Dropdown component as web component
The dropdown component gets list data as list input and shows it as dropdown When clicking on one item in the dropdown component, selectionChange event will be triggered
Run the index.html
In index.html
there is example usage of the custom web component
In dropdown-list.js
there is the definition of the dropdown-list, also example how to use it and set its values
-
The dropdown’s markup and functionality will be inside the custom element according to best practices
-
The dropdown items will be configurable so you can use the same dropdown component for different lists
-
For your ease, you can use this dropdown implementation: https://www.w3schools.com/howto/howto_css_dropdown.asp ,You can of course write your own but it is really unnecessary
-
The dropdown implementation MUST be inside the customElement
-
For presentation, please also create an index.html file with the dropdown
-
When selecting an element, show the selected item on the screen