JavaScript
- 2 ответа
- 0 вопросов
0
Вклад в тег
let a19 = {
"red": ['Akademmistechko', 'Nyvky', 'Universytet', 'Lisova'],
"blue": ['Minska', 'Obolon', 'Pochaina', 'Holosiivska'],
"green": ['Syrets', 'Zoloti Vorota', 'Klovska', 'Vidubichi']
}
function f19() {
let i19 = document.querySelector('.i-19').value;
let out19 = document.querySelector('.out-19');
let out = '';
for (let key in a19) {
for (const item of a19[key]) {
if (item.toLowerCase() == i19 || item == i19) {
out += key;
}
}
}
out19.style.background = out;
out19.style.height = "100px";
}
document.querySelector('.b-19').onclick = f19;