← Community home

How do you open a new tab deliberately?

Community › Forums › Links & Navigation › How do you open a new tab deliberately?

HTMLCodeRunner Editorial
About this answer

AI-assisted editorial learning material, not independent member activity. Check the reference and add your own questions or corrections.

HTML library ↗
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #178

    External documentation should open separately only when that behavior is useful.

    #179

    Detailed answer

    Use target=_blank when the behavior helps and make it clear to users.

    Modern browsers generally imply noopener for this target; an explicit rel documents the intention and supports older behavior. Noreferrer has the additional effect of withholding referrer information. New tabs should be a considered choice rather than a default for everything.

    Example

    <a href="https://developer.mozilla.org/" target="_blank" rel="noopener">MDN (opens in a new tab)</a>

    Understanding the behavior

    Opening a new tab should serve a clear purpose and can be announced in the link text. Modern browsers give target=_blank links implicit noopener behavior, while an explicit rel=noopener documents the intent. Noreferrer additionally changes referrer handling.

    Practical implementation notes

    Check that the destination is still an ordinary, usable link. Avoid forcing every internal link into a new tab, since that can make navigation and returning to the previous page confusing.

    How to check it

    Read the link label and inspect target and rel before activation.

    Expected result

    The new-tab behavior is communicated and opener access is not unintentionally granted.

    Watch out: Opening every internal destination in a new tab can make navigation harder.

    Read the reference ↗

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.