Recall & Review
beginner
What is the purpose of the <a> tag in HTML?
The <a> tag creates a clickable link that can take you to another webpage, a different part of the same page, or start an email.
Click to reveal answer
beginner
What attribute of the <a> tag specifies the destination URL?
The
href attribute sets the URL where the link will go when clicked.Click to reveal answer
beginner
How do you make a link open in a new browser tab?
Add
target="_blank" to the <a> tag to open the link in a new tab.Click to reveal answer
intermediate
Why should you use the
rel="noopener noreferrer" attribute with target="_blank"?It improves security and privacy by preventing the new page from accessing the original page's window object.
Click to reveal answer
beginner
What does this anchor tag do? <a href="#section2">Go to Section 2</a>
It links to a part of the same page with the ID
section2, scrolling the page to that section.Click to reveal answer
Which attribute is required to make an <a> tag a clickable link?
✗ Incorrect
The
href attribute defines the link's destination URL.What happens if you omit the
href attribute in an <a> tag?✗ Incorrect
Without
href, the <a> tag is not a link and is not clickable.How do you make a link open in the same tab?
✗ Incorrect
By default, links open in the same tab without extra attributes.
What does
href="#top" do in an anchor tag?✗ Incorrect
The hash (#) links to an element with the ID 'top' on the same page.
Which attribute improves security when using
target="_blank"?✗ Incorrect
Adding
rel="noopener noreferrer" prevents the new page from accessing the original page.Explain how to create a link that opens a new website in a new browser tab using the anchor tag.
Think about the attributes needed for the link destination and opening behavior.
You got /4 concepts.
Describe how you can link to a specific section within the same webpage using an anchor tag.
Consider how the URL can point to a part of the current page.
You got /3 concepts.