const type = document.querySelector('#type');
const price = document.querySelector('#price');
const minPrices = {
bungalo: 0,
flat: 1000,
house: 5000,
palace: 10000,
};
type.addEventListener('change', function() {
const minPrice = minPrices[this.value];
price.min = minPrice;
price.value = Math.max(minPrice, price.value);
});
type.dispatchEvent(new Event('change'));