0

How can I set an input element to be immediately ready for the user to type in, i.e, they do not have to click on the input to start typing, as soon as it renders, it displays the flashing vertical line and enables them to type straight away?

TBouder
  • 2,539
  • 1
  • 14
  • 29
Perplexityy
  • 561
  • 1
  • 9
  • 26

2 Answers2

1

You can use autofocus (more info)

<form action="/action_page.php">
  First name: <input type="text" name="fname" autofocus><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit">
</form>
TBouder
  • 2,539
  • 1
  • 14
  • 29
1

You should use the attribute autofocus like in this example: https://www.w3schools.com/tags/att_input_autofocus.asp

Troy Kessler
  • 377
  • 1
  • 8