![]() |
The input |
Example:
HTML
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" autofocus><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname">
</form>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The input autofocus attribute</h1>
<p>The autofocus attribute specifies that the input field should automatically get focus when the page loads.</p>
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" autofocus><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Hoow is to look HTML autofocus Attribute | HTML Input Attributes |
Full Code Example of HTML autofocus Attribute | HTML Input Attributes |
Read Full: | HTML Input Attributes |
Category: | Web Tutorial |
Sub Category: | HTML Input Attributes |
Uploaded: | 1 year ago |
Uploaded by: | Admin |
Views: | 58 |
Reffered: https://www.w3schools.com/html/html_form_attributes.asp