<html>
<head>
<title></title>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="点击我,打开新窗口!" / >
<script type="text/javascript">
function Wopen(){
window.open('http://www.baidu.com','target=_blank')
}
</script>
</body>
</html>
本文介绍了一种使用HTML和JavaScript代码在新窗口中打开特定URL的方法。通过在按钮的onClick事件中调用window.open函数,可以实现这一目标。示例代码展示了如何设置此功能,并指向了百度网站作为演示。
818

被折叠的 条评论
为什么被折叠?



