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 {
|
||||
background-color: #2980b9; /* Gleiche Hover-Farbe */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@ -551,6 +552,18 @@
|
||||
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>
|
||||
|
||||
</body>
|
||||
|
Loading…
x
Reference in New Issue
Block a user