---
title: Use tabindex to Add Keyboard Focus to an Element
localeTitle: 使用tabindex将键盘焦点添加到元素
---
## 使用tabindex将键盘焦点添加到元素

按照说明：

将tabindex属性添加到p标记并将其值设置为“0”。

第16行 \`\`\`CSS

说明：填写所有信息，然后单击“ **提交”**
```
becomes: 
 ```css 
    <p tabindex="0">Instructions: Fill in ALL your information then click <b>Submit</b></p> 
```

这样，当用户在页面中进行选项卡时，它将接收键盘焦点。