freeCodeCamp/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/make-dead-links-using-the-h...

31 lines
704 B
Markdown
Raw Normal View History

---
id: bad87fee1348bd9aedf08817
title: '用 # 号来创建链接占位符'
challengeType: 0
videoUrl: 'https://scrimba.com/p/pVMPUv/cMdkytL'
forumTopicId: 18230
---
# --description--
有时你想为网站添加一个 `a`,但如果你还不确定要将它链接到哪儿,这时可以使用链接占位符。
在后面的课程中我们会学到:如何轻松通过`JavaScript`更改链接指向的地址。
# --instructions--
`href`属性的当前值是指向 "`https://freecatphotoapp.com`",将`href`属性的值替换为`#`,就可以创建固定链接。
例如: `href="#"`
# --hints--
`a` 的`href`属性应为 "#"。
```js
assert($('a').attr('href') === '#');
```
# --solutions--