重複の可能性:
bind または click でイベント ハンドラーをバインドしていない場合、jquery click() を呼び出して <a> リンクをたどることはできますか?
次のコードを書きました。
<div style="background-color:orange">Click me to open the link
<br>
<a target="_blank" href="http://example.com">Link</a>
</div>
<script>
jQuery('div').click(function(){
jQuery('a').click();
});
jQuery('a').click(function(e){
alert('It came here!');
e.stopPropagation();
return true;
});
</script>
しかし、リンクが開かない。
更新: A タグにターゲット属性を追加しました。