let a1 = {
"b": 17,
"e": 22,
"j": 17,
"j1": 17,
"j2": 17,
"k": 22,
"j3": 17,
"d": 54
};
function f() {
let znach = document.querySelector(".i").value;
for (let keys in a1) {
if (a1[keys] == znach) {
document.querySelector(".out").innerHTML += keys + " ";
}
if (a1[keys] != znach) {
document.querySelector(".out").innerHTML += " ";
}
}
}
document.querySelector(".b").onclick = f;
Нарушена логика условий if/else