点击查看更多猫咪图片。
猫咪最喜欢的三件东西:
- 猫薄荷
- 激光笔
- 千层饼
猫咪最讨厌的三件东西:
- 跳蚤
- 打雷
- 同类
Placeholder
占位符是用户在input
输入框中输入任何东西前的预定义文本。
你可以像这样创建一个占位符:
<input type="text" placeholder="this is placeholder text">
input
输入框的placeholder
占位符文本设置为 “猫咪图片地址”。
input
输入框添加一个placeholder
属性。
testString: assert($("input[placeholder]").length > 0);
- text: 设置placeholder
属性的值为 ”猫咪图片地址“。
testString: assert($("input") && $("input").attr("placeholder") && $("input").attr("placeholder").match(/猫咪图片地址/gi));
- text: 完整的input
元素应有一个结束标签
testString: assert(!code.match(/input
输入框的语法必须正确。
testString: assert($("input[type=text]").length > 0);
```
点击查看更多猫咪图片。
猫咪最喜欢的三件东西:
猫咪最讨厌的三件东西: