2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
id: bad87fee1348bd9aedf08829
|
|
|
|
title: Create a Text Field
|
|
|
|
challengeType: 0
|
|
|
|
videoUrl: 'https://scrimba.com/p/pVMPUv/c2EVnf6'
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
Now let's create a web form.
|
|
|
|
Input elements are a convenient way to get input from your user.
|
|
|
|
You can create a text input like this:
|
|
|
|
<code><input type="text"></code>
|
|
|
|
Note that <code>input</code> elements are self-closing.
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
<section id='instructions'>
|
|
|
|
Create an <code>input</code> element of type <code>text</code> below your lists.
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 14:37:37 +01:00
|
|
|
tests:
|
|
|
|
- text: Your app should have an <code>input</code> element of type <code>text</code>.
|
|
|
|
testString: 'assert($("input[type=text]").length > 0, ''Your app should have an <code>input</code> element of type <code>text</code>.'');'
|
2018-09-30 23:01:58 +01: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>
|
2018-10-02 15:02:53 +01:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
2018-10-02 15:02:53 +01:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
<p>Things cats love:</p>
|
|
|
|
<ul>
|
|
|
|
<li>cat nip</li>
|
|
|
|
<li>laser pointers</li>
|
|
|
|
<li>lasagna</li>
|
|
|
|
</ul>
|
|
|
|
<p>Top 3 things cats hate:</p>
|
|
|
|
<ol>
|
|
|
|
<li>flea treatment</li>
|
|
|
|
<li>thunder</li>
|
|
|
|
<li>other cats</li>
|
|
|
|
</ol>
|
2018-10-02 15:02:53 +01:00
|
|
|
|
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
</main>
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|
|
|
|
</section>
|