我正在制作一个可点击的表格行,但一旦点击我想打开一个新标签.我尝试使用data-target但是没有用.
<tr class="table-row" data-href="mypage.php" data-target="_blank"></tr>
<script type="text/javascript">
$(document).ready(function ($) {
$(".table-row").click(function () {
window.document.location = $(this).data("href");
});
});
</script>
Run Code Online (Sandbox Code Playgroud)