freeCodeCamp/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-html-forms-by-buildin.../60f5c3e399ff1a05629964e4.md

64 lines
1.3 KiB
Markdown
Raw Normal View History

---
id: 60f5c3e399ff1a05629964e4
title: 步驟 11
challengeType: 0
dashedName: step-11
---
# --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>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Registration Form</title>
<link rel="stylesheet" href="styles.css" />
</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;
color: #f5f6f7;
}
```