2022-07-18 16:29:02 +00:00
|
|
|
---
|
|
|
|
id: 60f5c3e399ff1a05629964e4
|
2022-09-28 08:52:29 +00:00
|
|
|
title: 步驟 11
|
2022-07-18 16:29:02 +00:00
|
|
|
challengeType: 0
|
2022-09-28 08:52:29 +00:00
|
|
|
dashedName: step-11
|
2022-07-18 16:29:02 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
|
|
正如標題所述的那樣,你正在創建表單。 因此,在 `p` 元素之後,插入一個 `form` 元素,其 `action` 屬性值爲 `https://register-demo.freecodecamp.org`。
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
|
|
應該在 `p` 元素之後添加一個 `form` 元素。
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert.exists(document.querySelector('p + form'));
|
|
|
|
```
|
|
|
|
|
|
|
|
應該給 `form` 元素設置一個 `action` 屬性。
|
|
|
|
|
|
|
|
```js
|
|
|
|
// Default action points to window location
|
|
|
|
assert.notEqual(document.querySelector('form')?.action, window?.location?.href);
|
|
|
|
```
|
|
|
|
|
|
|
|
`action` 屬性的值應該設置爲 `https://register-demo.freecodecamp.org`。
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert.equal(document.querySelector('form')?.action, 'https://register-demo.freecodecamp.org/');
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```html
|
|
|
|
<!DOCTYPE html>
|
2022-09-28 08:52:29 +00:00
|
|
|
<html lang="en">
|
2022-07-18 16:29:02 +00:00
|
|
|
<head>
|
2022-09-28 08:52:29 +00:00
|
|
|
<meta charset="UTF-8">
|
2022-07-18 16:29:02 +00:00
|
|
|
<title>Registration Form</title>
|
2022-09-28 08:52:29 +00:00
|
|
|
<link rel="stylesheet" href="styles.css" />
|
2022-07-18 16:29:02 +00:00
|
|
|
</head>
|
|
|
|
--fcc-editable-region--
|
|
|
|
<body>
|
|
|
|
<h1>Registration Form</h1>
|
|
|
|
<p>Please fill out this form with the required information</p>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
--fcc-editable-region--
|
|
|
|
</html>
|
|
|
|
```
|
|
|
|
|
|
|
|
```css
|
|
|
|
body {
|
|
|
|
width: 100%;
|
|
|
|
height: 100vh;
|
|
|
|
margin: 0;
|
|
|
|
background-color: #1b1b32;
|
2022-09-28 08:52:29 +00:00
|
|
|
color: #f5f6f7;
|
2022-07-18 16:29:02 +00:00
|
|
|
}
|
|
|
|
```
|