RonPringadi
RonPringadi

Reputation: 1494

Browser open a new tab and disable url edit

In the html and javascript world is there a way to have a click on link, open a new tab, and disable url/address edit?

The code below does the open a new tab, but doesn't restrict the url/address edit. How do I lock the url/address?

<a href="https://somewebsite.com" target="_blank">Feedback</a>

Upvotes: 1

Views: 1925

Answers (2)

MD. RAKIB HASAN
MD. RAKIB HASAN

Reputation: 3956

You can user Javascript function:

window.open("http://someurl", "myPopup", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=120,height=120')

Upvotes: 1

fiveobjects
fiveobjects

Reputation: 4269

You may choose to hide the address bar in a new window. Make href empty and use onclick function to open the window.

<a href=""
    onclick="window.open('https://google.com'
    ,'Title','directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');">Open</a>

Upvotes: 3

Related Questions