(Solved) : Html Coding File Named Infojs 3 Different Variables Name Phone Number Order Number E 1 10 Q43958509 . . .
HTML Coding
I have a file named info.js and it has 3 different variables. Ithas name, phone number and order number (i.e 1-10) properties foreach item and then I have a list (let people = [leia, john, fred];)I am trying to make an HTML drop-down menu however I need todynamically create the drop-down menu items from the people arrayin my external info.js file. I do not know how to call it in theHTML file I have. I tried the code in the image below but it won’tdisplay the drop-down options from the people array.
My code trial:

Example of person array content:

I have looked at many different StackExchange posts howevernothing is working. Please help 🙁
<script src = “info.js”> function addPerson () { var dropdowns; for (var i = 0; i < people. length; i++) { dropdowns = people[i].name; for (var i = 0; i < dropdowns. length; i++) { var openDropdown = dropdowns [i]; if (openDropdown.classList.contains(‘show’)) { openDropdown.classList.remove(‘show’); } } } </script> <button onclick=”addPerson ()” class=”dropbtn”>Select a Restaurant</button> let fred = { name: “Fred Logan”, phone_number: 1234567890, order: 5, Show transcribed image text function addPerson () { var dropdowns; for (var i = 0; i
Expert Answer
Answer to HTML Coding I have a file named info.js and it has 3 different variables. It has name, phone number and order number (i….
OR