Well, I'm having a hard time capturing the items inside an Json object.
Follow the code below to illustrate.
var tipos = [
{
"code": "258",
"label": "Sapatos"
},
{
"code": "547",
"label": "Kits"
},
{
"code": "1213",
"label": "Whey Protein"
},
{
"code": "3110",
"label": "Bolas"
},
{
"code": "4316",
"label": "Camisas de Time"
},
{
"code": "1251",
"label": "Cuecas"
}];
console.log (types)
I can capture every array by giving console.log ()
TheproblemisthatIneedtoassociatethisinhtml,type,createabutton(input)wheretheuserwillpasteonlythenameoftheproducttypesandwillreturnthecode,orviceversa.
Itwouldbemoreorlesslikethis
TheusertypesBallsandshouldreturn{"code": "3110", "label": "Bolas"}
If he types Balls, Kits , he should return {"code": "3110", "label": "Bolas"}, {"code": "547","label": "Kits"}
Thanks for the help!