0

I'm wondering if there is a javascript library i can use in the front end where i can pass in a JSON object such as:

{
  "Data": [
    {
      "id": "1",
      "colour": "red",
      "size": "big",
      "weight": "light"
    },
    {
      "id": "2",
      "colour": "red",
      "size": "small",
      "weight": "light"
    },
    {
      "id": "3",
      "colour": "green",
      "size": "big",
      "weight": "heavy"
    }
  ]
}

And if i have multiple dropdown options on the webpage to search for colour/size/weight, if the user selects the colour red, then the weight drop down will only show light and the size will show big and small (i.e. the results from id 1 and 2 where the colour is red) and if the user chooses green then only option left in size would be big as there is only one item with the colour green

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.