--- id: 587d7790367417b2b2512aaf title: Make Links Navigatable with HTML Access Keys challengeType: 0 videoUrl: '' localeTitle: 使链接可以使用HTML访问密钥进行导航 --- ## Description
HTML提供了accesskey属性,用于指定要激活元素或将焦点置于元素的快捷键。这可以使键盘用户的导航更有效。 HTML5允许在任何元素上使用此属性,但在与交互元素一起使用时,它特别有用。这包括链接,按钮和表单控件。这是一个例子: <button accesskey="b">Important Button</button>
## Instructions
Camper Cat希望两个博客文章标题之间的链接具有键盘快捷键,这样他的网站用户就可以快速浏览完整的故事。为两个链接添加一个accesskey属性,并将第一个设置为“g”(对于加菲猫),将第二个设置为“c”(对于Chuck Norris)。
## Tests
```yml tests: - text: 您的代码应该为id为“first” a标记添加一个accesskey属性。 testString: 'assert($("#first").attr("accesskey"), "Your code should add an accesskey attribute to the a tag with the id of "first".");' - text: 您的代码应该为id为“second” a标记添加一个accesskey属性。 testString: 'assert($("#second").attr("accesskey"), "Your code should add an accesskey attribute to the a tag with the id of "second".");' - text: 您的代码应在id为“first”到“g” a标记上设置accesskey属性。请注意,案件很重要。 testString: 'assert($("#first").attr("accesskey") == "g", "Your code should set the accesskey attribute on the a tag with the id of "first" to "g". Note that case matters.");' - text: 您的代码应设置accesskey的属性a标签与id “第二”到“C”的。请注意,案件很重要。 testString: 'assert($("#second").attr("accesskey") == "c", "Your code should set the accesskey attribute on the a tag with the id of "second" to "c". Note that case matters.");' ```
## Challenge Seed
```html

Deep Thoughts with Master Camper Cat

The Garfield Files: Lasagna as Training Fuel?

The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...

Is Chuck Norris a Cat Person?

Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...

```
## Solution
```js // solution required ```