FirstName: Home >Web Front-end >HTML Tutorial >Put autofocus in textbox when page loads when HTML page doesn't 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 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!Put autofocus in textbox when page loads when HTML page doesn't support JavaScript
<!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>