--- id: 587d778b367417b2b2512aa8 title: Add an Accessible Date Picker challengeType: 0 videoUrl: '' localeTitle: 添加无障碍日期选择器 --- ## Description
表单通常包含input字段,可用于创建多个不同的表单控件。此元素的type属性指示将创建哪种输入。您可能已经注意到text并在先前的挑战中submit输入类型,HTML5引入了一个指定date字段的选项。根据浏览器支持,当日期选择器处于焦点时,它会在input字段中显示,这使得所有用户都可以更轻松地填写表单。对于旧版浏览器,该类型将默认为text ,因此有助于向用户显示标签中的预期日期格式或以及占位符文本以防万一。这是一个例子:
<label for =“input1”>输入日期:</ label>
<input type =“date”id =“input1”name =“input1”>
## Instructions
Camper Cat正在举办一场真人快打比赛,并想让他的竞争对手看看哪个日期效果最佳。添加一个input标记,其type属性为“date”, id属性为“pickdate”, name属性为“date”。
## Tests
```yml tests: - text: 您的代码应为日期选择器字段添加一个input标记。 testString: 'assert($("input").length == 2, "Your code should add one input tag for the date selector field.");' - text: 您的input标记应具有值为date的type属性。 testString: 'assert($("input").attr("type") == "date", "Your input tag should have a type attribute with a value of date.");' - text: 您的input标记应具有值为pickdate的id属性。 testString: 'assert($("input").attr("id") == "pickdate", "Your input tag should have an id attribute with a value of pickdate.");' - text: 您的input标记应具有值为date的name属性。 testString: 'assert($("input").attr("name") == "date", "Your input tag should have a name attribute with a value of date.");' ```
## Challenge Seed
```html

Tournaments

Mortal Kombat Tournament Survey

Tell us the best date for the competition

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