JustPaste.it

<!DOCTYPE html>
<html>
<head>
 <script>
 
 function laden() {
   document.addEventListener('keydown', (e) => {
   alert('document ' + e.key);
   })

 }

 
function telefon(){
alert("Telefon");
document.getElementById('fname').select();
window.dispatchEvent(new KeyboardEvent('keydown', {'key': 'F12', ctrlKey: true}));
}
</script>
</head>
<body  onload="laden()">
<form action="/action_page.php">
      <input type="text" id="fname" name="fname" value="2313213"><br><br>
    <button onclick="telefon()">Test</button>
</form>

</body>
</html>