this seems like it is a very basic question that i can't just can't seem to search properly so i'm going to keep it brief unless someone request otherwise. I have the following javascript function that works,
zipCode.onchange = function () {
var zipPrice = document.getElementById('tripCost');
var zipCity = document.getElementById('cityState')
if ('z'+zipCode.value === 'z39429') {
zipPrice.textContent = price$$$$[7].z39429;
zipCity.textContent = price$$$$[8].z39429;
} else if ('z'+zipCode.value === 'z39483'){
zipPrice.textContent = price$$$$[7].z39483;
zipCity.textContent = price$$$$[8].z39483;
}
in which it fills out the city and state info on the form as well as lists a price for the customer to gauge the cost. the two relevant objects in the array contain well over a dozen zip codes however, and i feel like there aught to be a simpler way to do this in which i compare the user input directly to the property rather than manually keying in each input required.
one other note, i put the 'z' with the zip code number because i wasn't sure if my property names could start with a number. if thats no the case the ill change the property names and remove the 'z+' from the function.