Home > Web Front-end > HTML Tutorial > 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
Release: 2023-09-07 22:53:02
forward
1009 people have browsed it

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>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template