[英]Open link in new tab from pop-up using Jquery
I am trying to open up a new page using a link in a pop-up in a new tab. 我正在尝试使用新标签页弹出窗口中的链接打开一个新页面。 I am new to Jquery so I am unsure if this is on the correct track:
我是Jquery的新手,所以不确定这是否正确:
$('.modal-content a').click(function() {
alert( "Handler for .click() called." );
a.set('target', '_blank');
});
HTML: HTML:
<div class="modal-content">
<div>
<h1>This is pop-up</h1>
</div>
<p><a href="www.google.co.nz">Open in new window</a></p>
</div>
"modal-content" is the class name of the pop-up div. “ modal-content”是弹出div的类名称。 I am not sure if I am calling the link element correctly.
我不确定我是否正确调用了link元素。 There is no unique identifier on the tag.
标签上没有唯一的标识符。
Any help will greatly be appreciated. 任何帮助将不胜感激。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.