<!DOCTYPE HTML><html>
<body>
  <div contenteditable id="x" style="height: 30px; outline: none;"></div>
<script>
  var div = document.getElementById('x');
  div.focus();
</script>
</body>
</html>