How to stay on current window when the link opens in new tab?

3 replies
When a visitor clicks on a link.

Is there a way to stay on the current window instead of going to the tab ?

Html? Any other code or way to do this?

Tomas
#current #link #opens #stay #tab #window
Avatar of Unregistered
  • Profile picture of the author DABK
    Do not add the target tab.


    If you add
    a target="_blank"
    to the link, it will open in a new page.

    https://www.w3schools.com/tags/tryit...yhtml_a_target




    Originally Posted by Tomas Lodén View Post

    When a visitor clicks on a link.

    Is there a way to stay on the current window instead of going to the tab ?

    Html? Any other code or way to do this?

    Tomas
    {{ DiscussionBoard.errors[11693970].message }}
  • Profile picture of the author luciesmazanska
    Originally Posted by Tomas Lodén View Post

    When a visitor clicks on a link.

    Is there a way to stay on the current window instead of going to the tab ?

    Html? Any other code or way to do this?

    Tomas
    There should be option in your website provider where you can set this up.
    Signature
    ★★★★★
    {{ DiscussionBoard.errors[11693975].message }}
  • Profile picture of the author Jonathan S
    If you're using HTML and you want your link to open in the same window, normally you don't have to do anything. Otherwise just add the target attributes in your html code: target="_self" not target="_blank" as this will open the link in a separate window.

    <a href="mylink.com" target="_self">My Link</a>

    Here are available target attributes:
    _blank = Opens the linked document in a new window or tab
    _self = Opens the linked document in the same frame as it was clicked (this is default)
    _parent = Opens the linked document in the parent frame
    _top = Opens the linked document in the full body of the window
    framename = Opens the linked document in the named iframe
    i. e. <a target="_blank|_self|_parent|_top|framename">

    If you're using WordPress, just highlight link holder then click Insert/edit link and 'uncheck' the Open link in a new tab radio button.
    {{ DiscussionBoard.errors[11694017].message }}
Avatar of Unregistered

Trending Topics