FirstName: FirstName:

Home  >  Article  >  Web Front-end  >  Put autofocus in textbox when page loads when HTML page doesn't support JavaScript

Put autofocus in textbox when page loads when HTML page doesn't support JavaScript

PHPz
PHPzforward
2023-09-07 22:53:02948browse

Put autofocus in textbox when page loads when HTML page doesnt support JavaScript

The autofocus property is a Boolean property. If present, it specifies that the element should automatically receive focus when the page loads. An example is given below

<!DOCTYPE html>
<html>
   <body>
      <form action = "/new.php">
         First Name: <input type = "text" name = "fname" autofocus><br>
         Last Name: <input type = "text" name = "lname"><br>
         <input type="submit">
      </form>
   </body>
</html>

The above is the detailed content of Put autofocus in textbox when page loads when HTML page doesn't support JavaScript. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete