fix: Update packages and fix local dev (#26907)
<!-- Please follow this checklist and put an x in each of the boxes, like this: [x]. It will ensure that our team takes your pull request seriously. --> - [x] I have read [freeCodeCamp's contribution guidelines](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/CONTRIBUTING.md). - [x] My pull request has a descriptive title (not a vague title like `Update index.md`) - [x] My pull request targets the `master` branch of freeCodeCamp.
This commit is contained in:
committed by
mrugesh mohapatra
parent
153e1c9f38
commit
7da04a348b
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: Autofocus Attribute
|
||||
---
|
||||
## Autofocus Attribute | HTML5
|
||||
|
||||
The **autofocus** attribute is a boolean attribute.
|
||||
|
||||
When present, it specifies that the element should automatically get input focus when the page loads.
|
||||
|
||||
Only one form element in a document can have the **autofocus** attribute. It cannot be applied to `<input type="hidden">`.
|
||||
|
||||
### Applies to
|
||||
|
||||
| Element | Attribute |
|
||||
| :-- | :-- |
|
||||
| `<button>` | autofocus |
|
||||
| `<input>` | autofocus |
|
||||
| `<select>` | autofocus |
|
||||
| `<textarea>` | autofocus |
|
||||
|
||||
### Example
|
||||
|
||||
```html
|
||||
<form>
|
||||
<input type="text" name="fname" autofocus>
|
||||
<input type="text" name="lname">
|
||||
</form>
|
||||
```
|
||||
|
||||
### Compatibility
|
||||
|
||||
This is an HTML5 attribute.
|
||||
|
||||
#### More Information:
|
||||
|
||||
[HTML autofocus Attribute](https://www.w3schools.com/tags/att_autofocus.asp) on w3schools.com
|
||||
|
||||
[<input> autofocus attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) on MDN web docs
|
Reference in New Issue
Block a user