Reputation: 75
How do I open this link to open in a new tab. None of the other question asked seem to specify how to mesh this with the target of the link being defined in the JS file. Please help!
HTML:
<div>
<p><span id="popUpMoreLink">Contact Me</span></p>
</div>
JS:
$('#popUpMoreLink').click(function () {
window.location = 'mailto:[email protected]?Subject=Inquiry';
});
Upvotes: 0
Views: 178
Reputation: 3374
window.open() will fire up a new window.
$('#popUpMoreLink').click(function () {
window.open('mailto:[email protected]?Subject=Inquiry');
});
but since the link is a "mailto:" (it opens thunderbird / outlook / whatever mail client is installed on the client's system) I'm not sure what you're trying to achieve.
Upvotes: 1
Reputation: 75
Got it!
Instead of
window.location
it is
window.open
$(function(){
$('#popUpMoreLink').click(function() {
window.open('mailto:[email protected]?Subject=Inquiry');
});
});
Upvotes: 0