0
0
HTMLmarkup~20 mins

Opening links in new tab in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Link Opener Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
Correct attribute to open link in new tab
Which attribute and value combination correctly opens a link in a new browser tab?
HTML
<a href="https://example.com" _____>Visit Example</a>
Atarget="_blank"
Bopen="new"
Cnewtab="true"
Dhref="_new"
Attempts:
2 left
💡 Hint
The attribute starts with 'target' and the value is a special keyword.
🧠 Conceptual
intermediate
2:00remaining
Security risk when opening links in new tab
What security risk can occur if you open links in a new tab using target="_blank" without extra precautions?
AThe link will automatically download the page content.
BThe link will not open at all in some browsers.
CThe new tab will always open in incognito mode.
DThe new page can access and manipulate the original page via JavaScript.
Attempts:
2 left
💡 Hint
Think about what the new page can do to the original page if not restricted.
rendering
advanced
2:00remaining
Visual result of link with target and rel attributes
What will the user see when clicking this link?
<a href="https://openai.com" target="_blank" rel="noopener">OpenAI</a>
HTML
<a href="https://openai.com" target="_blank" rel="noopener">OpenAI</a>
AThe link opens in the same tab and replaces the current page.
BThe link opens in a new tab without giving the new page access to the original page.
CThe link opens in a new tab but the new page can access the original page.
DThe link does not open because rel="noopener" blocks it.
Attempts:
2 left
💡 Hint
rel="noopener" is a security feature that does not block opening.
accessibility
advanced
2:00remaining
Accessibility best practice for links opening in new tabs
Which practice improves accessibility when links open in new tabs?
AInform users in the link text or with ARIA that the link opens in a new tab.
BUse only color changes to indicate the link opens in a new tab.
CRemove the href attribute to prevent confusion.
DDisable keyboard navigation for links that open in new tabs.
Attempts:
2 left
💡 Hint
Think about users who rely on screen readers or keyboard navigation.
selector
expert
2:00remaining
CSS selector for styling links that open in new tabs
Which CSS selector correctly targets all links that open in new tabs using target="_blank"?
Aa.newtab { color: blue; }
Ba[href^="http"] { color: blue; }
Ca[target="_blank"] { color: blue; }
Da[target_blank] { color: blue; }
Attempts:
2 left
💡 Hint
Attribute selectors use square brackets with attribute name and value.