Click here to view more cat photos.
Things cats love:
- cat nip
- laser pointers
- lasagna
Top 3 things cats hate:
- flea treatment
- thunder
- other cats
id
属性。使用id
属性有几个好处:您可以使用id
来设置单个元素的样式,稍后您将学习如何使用它来使用JavaScript选择和修改特定元素。 id
属性应该是唯一的。浏览器不会强制执行此操作,但这是广泛认可的最佳实践。所以请不要给多个元素赋予相同的id
属性。这里有一个例子,说明如何为你的h2
元素提供cat-photo-app
<h2 id="cat-photo-app">
: <h2 id="cat-photo-app">
form
元素添加id cat-photo-form
。 form
元素添加cat-photo-form
的id。
testString: 'assert($("form").attr("id") === "cat-photo-form", "Give your form
element the id of cat-photo-form
.");'
```
Click here to view more cat photos.
Things cats love:
Top 3 things cats hate: