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