funktion zur suche per enter taste hinzugefügt
This commit is contained in:
parent
516b95d0f4
commit
9d8c4597e6
13
index.html
13
index.html
@ -198,6 +198,7 @@
|
|||||||
.koenig-button:hover {
|
.koenig-button:hover {
|
||||||
background-color: #2980b9; /* Gleiche Hover-Farbe */
|
background-color: #2980b9; /* Gleiche Hover-Farbe */
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -551,6 +552,18 @@
|
|||||||
checkbox.checked = false; // Alle Checkboxen auf unchecked setzen
|
checkbox.checked = false; // Alle Checkboxen auf unchecked setzen
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
document.addEventListener('keypress', function(event) {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
const searchInput = document.getElementById('query');
|
||||||
|
// Optional: Überprüfen, ob das Suchfeld gerade fokussiert ist oder ob ein Suchbegriff vorhanden ist
|
||||||
|
if (document.activeElement === searchInput || searchInput.value.trim() !== "") {
|
||||||
|
event.preventDefault();
|
||||||
|
performSearch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user