Код: Выделить всё
document.addEventListener("keydown", function (event) {
if (event.key === '/') {
const searchInput = document.getElementById("searchInput");
if (searchInput) {
searchInput.focus();
}
}
});< /code>
jQuery можно использовать, если это необходимо, так как он включен в MediaWiki.
Подробнее здесь: https://stackoverflow.com/questions/796 ... -input-box