Reputation: 3945
So using the below link, when the user clicks on 'Terms and Conditions' I would like the T&C page to open in a separate browser. ATM it reloads the browser with the T&C page. I thought '_blank' opened a new tab?
<p>
Accept the <a href="~/TermsAndConditions" target=\"_blank\">
<span class="big-red">Terms and Conditions</span>
</a>
</p>
Upvotes: 1
Views: 2765
Reputation: 15860
Opening a new tab in a seperate browser isn't possible, I will assume you meant a new window of the same browser.
\"
escape qoutesAnd please note that you need to escape qoutes once you are inside the qoutes such as:
"<a href=\"href\"></a>"
Since you're in plain HTML and not inside some qoutations, so you don't need to write these statements. They are needed to tell the code that these qoutation signs are to written inside plain HTML and should not be treated as endings of the block qoutes!
However you can do this:
<a href="~/" target="_blank">Terms And Conditions</a>
You need to write this JS code
onclick="newwin()" // in the a tag
In the JS file as this:
function newwin () {
window.open("link"); // ~/termsandconditions
}
target="_blank"
does open a new tabHowever, target="_blank"
opens a new tab! :) So it is OK.
Upvotes: 1