1.8 KiB
1.8 KiB
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
bad87fee1348bd9aedf08817 | 用 # 號來創建鏈接佔位符 | 0 | https://scrimba.com/p/pVMPUv/cMdkytL | 18230 | make-dead-links-using-the-hash-symbol |
--description--
有時你想爲網站添加一個 a
元素,但還不確定要將它鏈接到哪裏。
當你使用 JavaScript
更改鏈接的指向時,這也很方便,我們將在後面的課程中介紹。
--instructions--
href
屬性的當前值是指向 “https://www.freecatphotoapp.com
”。 請將 href
屬性的值替換爲#
,以此來創建鏈接佔位符。
例如: href="#"
--hints--
a
的 href
屬性值應爲 "#"。
assert($('a').attr('href') === '#');
--seed--
--seed-contents--
<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="https://www.freecatphotoapp.com" target="_blank">cat photos</a>.</p>
<img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
</main>
--solutions--
<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#" target="_blank">cat photos</a>.</p>
<img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
</main>