farikweb,
<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="http://" name="form">
<label for="from">from:</label>
<input list="from-city" id="from" name="from" />
<datalist id="from-city">
<option value="Симферополь">
<option value="Коктебель">
<option value="Алушта">
</datalist>
<label for="to">to:</label>
<input list="to-city" id="to" name="to" />
<datalist id="to-city">
<option value="Симферополь">
<option value="Коктебель">
<option value="Алушта">
</datalist>
<output></output>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
let form = document.forms.form;
let msg = document.querySelector("output");
const Price = {
"Симферополь-Коктебель" : 2000,
"Коктебель-Симферополь" : 2000,
"Симферополь-Алушта" : 1000,
"Алушта-Симферополь" : 1000
};
const choice = function(event) {
let from = form.from.value;
let to = form.to.value;
let key = `${from}-${to}`;
let curPrice = key in Price ? Price[key] : 0;
msg.innerHTML = curPrice;
}
form.addEventListener("input", choice)
});
</script>
</body>
</html>