I need help with my code here. I cannot figure out how I can disable the options I have if they have "N/A" value.
Here's a piece of my code.
var priceByCategoryPL = {
// Apple Price
A: [{
name: "iPhone 4",
onee: "$89.00",
twoo: "$99.00",
thre: "N/A",
four: "N/A",
five: "N/A",
sixx: "N/A"
}]
}
function updateStorage()
{
let drpOptionsStorage = "<option value='' disabled selected>Select Storage</option>";
for (let key in storageByCategoryPL) {
if (storageByCategoryPL.hasOwnProperty(key) && selectedValue == key) {
let drpValues = storageByCategoryPL[key];
if (drpValues.length > 0) {
for (let storageInfo in drpValues) {
if (Object.keys(drpValues[storageInfo]).length > 0) {
for (let option in drpValues[storageInfo]) {
drpOptionsStorage += "<option value="+option+">" + drpValues[storageInfo][option] + "</option>";
}
}
}
}
break;
}
}
if (drpOptionsStorage.length > 0) {
storageDrp.innerHTML = drpOptionsStorage;
}
}
So basically, what this does is it selects the brand, model, storage and then shows the price. But in this scenario, I just want to disable the storage if the price is not applicable. If anyone can help me clear it up, it would help me a lot with my proj. Thanks guys.