2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
id: bad87fee1348bd9aedf08829
|
|
|
|
challengeType: 0
|
2019-12-26 20:05:59 +08:00
|
|
|
videoUrl: 'https://scrimba.com/p/pVMPUv/c2EVnf6'
|
|
|
|
forumTopicId: 16823
|
2020-10-01 17:54:21 +02:00
|
|
|
title: 创建一个输入框
|
2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
2019-12-26 20:05:59 +08:00
|
|
|
<section id='description'>
|
|
|
|
现在让我们来创建一个<code>form</code>表单。
|
|
|
|
<code>input</code>输入框可以让你轻松获得用户的输入。
|
|
|
|
你可以像这样创建一个文本输入框:
|
|
|
|
<code><input type="text"></code>
|
|
|
|
注意:<code>input</code>输入框是没有结束标记的。
|
|
|
|
</section>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
## Instructions
|
2019-12-26 20:05:59 +08:00
|
|
|
<section id='instructions'>
|
|
|
|
在列表下面创建一个<code>type</code>属性为<code>text</code>的<code>input</code>输入框。
|
|
|
|
</section>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
|
|
|
tests:
|
2019-12-26 20:05:59 +08:00
|
|
|
- text: '网页中有一个<code>type</code>属性为<code>text</code>的<code>input</code>输入框。'
|
|
|
|
testString: assert($("input[type=text]").length > 0);
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
<div id='html-seed'>
|
|
|
|
|
|
|
|
```html
|
|
|
|
<h2>CatPhotoApp</h2>
|
|
|
|
<main>
|
|
|
|
<p>Click here to view more <a href="#">cat photos</a>.</p>
|
2019-12-26 20:05:59 +08:00
|
|
|
|
|
|
|
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="一只仰卧着的萌猫"></a>
|
|
|
|
|
|
|
|
<p>猫咪最喜欢的三件东西:</p>
|
2018-10-10 18:03:03 -04:00
|
|
|
<ul>
|
2019-12-26 20:05:59 +08:00
|
|
|
<li>猫薄荷</li>
|
|
|
|
<li>激光笔</li>
|
|
|
|
<li>千层饼</li>
|
2018-10-10 18:03:03 -04:00
|
|
|
</ul>
|
2019-12-26 20:05:59 +08:00
|
|
|
<p>猫咪最讨厌的三件东西:</p>
|
2018-10-10 18:03:03 -04:00
|
|
|
<ol>
|
2019-12-26 20:05:59 +08:00
|
|
|
<li>跳蚤</li>
|
|
|
|
<li>打雷</li>
|
|
|
|
<li>同类</li>
|
2018-10-10 18:03:03 -04:00
|
|
|
</ol>
|
2019-12-26 20:05:59 +08:00
|
|
|
|
|
|
|
|
2018-10-10 18:03:03 -04:00
|
|
|
</main>
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
<section id='solution'>
|
|
|
|
</section>
|
2019-12-26 20:05:59 +08:00
|
|
|
|