0

I have some html code and I've heard that autofocus will speed up search results etc. How can I do that with existing code?

I have been looking on other threads etc how to do this and I have tried to understand but I can't if someone could help me out here I would be awesome.

<input type="text" class="form-control" id="query" name="query" value="<?php if($this->input->post('query')) { echo $this->input->post('query'); } ?>" placeholder="Search here">
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Elliot S
  • 41
  • 7

1 Answers1

0

Add the autofocus to your input attribute.

<input type="text" class="form-control" id="query" name="query" value="<?php if($this->input->post('query')) { echo $this->input->post('query'); } ?>" placeholder="Search here" autofocus>
Albzi
  • 15,431
  • 6
  • 46
  • 63