--- id: 587d778b367417b2b2512aa8 challengeType: 0 videoUrl: 'https://scrimba.com/c/cR3bRbCV' forumTopicId: 301008 title: 添加可访问的日期选择器 --- ## Description
表单中经常出现input标签,它可以用来创建多种表单控件。它的type属性指定了所要创建的input标签类型。 在以前的挑战中,你可能已经见过textsubmit类型的input标签,HTML5 引入了date类型来创建时间选择器。依赖于浏览器的支持,当点击input标签时,时间选择器会显示出来,这可以让用户填写表单更加容易。 对于旧版本的浏览器,type属性的默认值是text。这种情况下,可以利用label标签或者占位文本来提示用户input标签的输入类型为日期。 举个例子: ```html ```
## Instructions
Camper Cat 想举办一场比武大会,他想收集参赛者的最佳参赛时间。请为 Camper Cat 的页面添加一个input标签,其type属性值为 date,id属性为 pickdate,name属性为 date。
## Tests
```yml tests: - text: '你的代码中应该有 1 个input标签。' testString: assert($('input').length == 2); - text: '你的input标签的type属性值应该为 date。' testString: assert($('input').attr('type') == 'date'); - text: '你的input标签的id属性值应该为 pickdate。' testString: assert($('input').attr('id') == 'pickdate'); - text: '你的input标签的name属性值应该为 date。' testString: assert($('input').attr('name') == 'date'); ```
## Challenge Seed
```html

Tournaments

Mortal Kombat Tournament Survey

Tell us the best date for the competition

```
## Solution
```html // solution required ```