--- id: bad87fee1348bd9aedf08830 title: Add Placeholder Text to a Text Field challengeType: 0 videoUrl: '' localeTitle: 将占位符文本添加到文本字段 --- ## Description
占位符文本是在用户输入任何内容之前在input元素中显示的内容。您可以像这样创建占位符文本: <input type="text" placeholder="this is placeholder text">
## Instructions
将文本inputplaceholder值设置为“cat photo URL”。
## Tests
```yml tests: - text: 将placeholder属性添加到现有文本input元素。 testString: 'assert($("input[placeholder]").length > 0, "Add a placeholder attribute to the existing text input element.");' - text: 将占位符属性的值设置为“cat photo URL”。 testString: 'assert($("input") && $("input").attr("placeholder") && $("input").attr("placeholder").match(/cat\s+photo\s+URL/gi), "Set the value of your placeholder attribute to "cat photo URL".");' - text: 完成的input元素应该具有有效的语法。 testString: 'assert($("input[type=text]").length > 0 && code.match(/\s]+))?)+\s*|\s*)\/?>/gi), "The finished input element should have valid syntax.");' ```
## Challenge Seed
```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```
## Solution
```js // solution required ```