2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
id: bad87fee1348bd9aedf08801
|
|
|
|
title: Inform with the Paragraph Element
|
|
|
|
challengeType: 0
|
|
|
|
videoUrl: 'https://scrimba.com/p/pVMPUv/ceZ7DtN'
|
2019-07-31 11:32:23 -07:00
|
|
|
forumTopicId: 18202
|
2021-01-13 03:31:00 +01:00
|
|
|
dashedName: inform-with-the-paragraph-element
|
2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --description--
|
|
|
|
|
|
|
|
`p` elements are the preferred element for paragraph text on websites. `p` is short for "paragraph".
|
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
You can create a paragraph element like this:
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
`<p>I'm a p tag!</p>`
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --instructions--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
Create a `p` element below your `h2` element, and give it the text "Hello Paragraph".
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
**Note:** As a convention, all HTML tags are written in lowercase, for example `<p></p>` and not `<P></P>`.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --hints--
|
|
|
|
|
|
|
|
Your code should have a valid `p` element.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert($('p').length > 0);
|
|
|
|
```
|
|
|
|
|
|
|
|
Your `p` element should have the text `Hello Paragraph`.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert.isTrue(/hello(\s)+paragraph/gi.test($('p').text()));
|
2018-09-30 23:01:58 +01:00
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
Your `p` element should have a closing tag.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
```js
|
|
|
|
assert(
|
|
|
|
code.match(/<\/p>/g) &&
|
|
|
|
code.match(/<\/p>/g).length === code.match(/<p/g).length
|
|
|
|
);
|
|
|
|
```
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --seed--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
## --seed-contents--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
```html
|
|
|
|
<h1>Hello World</h1>
|
|
|
|
<h2>CatPhotoApp</h2>
|
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2019-04-22 02:07:05 -04:00
|
|
|
```html
|
|
|
|
<h1>Hello World</h1>
|
|
|
|
<h2>CatPhotoApp</h2>
|
|
|
|
<p>Hello Paragraph</p>
|
2018-09-30 23:01:58 +01:00
|
|
|
```
|