单击图像以在HTML页面中打开新选项卡 如何添加可点击图片以在html页面中打开新标签页?
答案 0 :(得分:-3)
尝试这个
https://www.w3schools.com/jsref/met_win_open.asp
<!DOCTYPE html>
<html>
<body>
<p>Click the button to open multiple windows.</p>
<a href onclick="myFunction()"> <img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;border:0">
</a></a>
<script>
function myFunction() {
window.open("http://www.google.com/");
window.open("https://www.w3schools.com/");
}
</script>
</body>
</html>