JAVASCRIPT:
function identifybrand ( allproducts,favBrand){
var favBrandList = new Array();
var prodType = document.getElementById('prodType').value;
for (var i=0;i<=allproducts.length;i++) {
if (favBrand == allproducts[i].brandName) {
favBrandList.push(allproducts[i]);
}
}
alert(favBrandList);
}
I couldnt access the favBrandList array outside the for loop. Does anyone have any idea why i m not able to access it?
allproducts? Have you tried alerting the values?