I've been grappling with this issue for a while now. My app receives data about individuals in JSON format:
"people": [
{
"name": "Ivan",
"city": "Moscow",
"country": "Russia"
},
{
"name": "John",
"city": "Seattle",
"country": "United States"
},
{
"name": "Michael",
"city": "Seattle",
"country": "United States"
}
]
My goal is to categorize them into groups based on their city, and display the options in dropdown <ul>
s. For example, if a user selects "Seattle", only John and Michael should be displayed within the <li>
elements.
Is there any efficient way to accomplish this task?