Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const showDropdown = () => {
- const structure = document.createElement("div");
- structure.classList.add("structure", "hide");
- users.forEach(user => {
- const { id, name, title } = user;
- const option = document.createElement("div");
- option.addEventListener("click", () => selectOption(name));
- option.setAttribute("id", id);
- const n = document.createElement("h5");
- n.textContent = name;
- const t = document.createElement("p");
- t.textContent = `(${title})`;
- option.appendChild(n);
- option.appendChild(t);
- structure.appendChild(option);
- });
- return structure;
- };
Add Comment
Please, Sign In to add comment