I am working on a website where the first action of the user is entering text.
I can focus()
the <input>
element, but the keyboard doesn't show up in Chrome (86) on Android (11). I found answers mentionning click()
but it doesn't change anything.
My code is below.
Thank you very much for your help.
<html>
<head>
</head>
<body>
<input/>
<script>
window.onload = e => {
let input = document.querySelector("input");
input.focus();
input.click();
};
</script>
</body>
</html>
Note however that if I have the following div, it works when I click on it: <div onclick='document.querySelector("input").focus()'/>
Does it mean that the keyboard cannot be shown outside a user driven event?