- <script>
function openwin(url) {
var a = document.createElement("a");
a.setAttribute("href", url);
a.setAttribute("target", "_blank");
a.setAttribute("id", "camnpr");
document.body.appendChild(a);
a.click();
}
</script>
<body>
<input type="button" id="btn" value="向东博客" onclick="openwin('http://justwinit.cn');" />
</body>
调用方式如下:
<input type="button" id="btn" value="向东博客" onclick="openwin('http://justwinit.cn');" />
<input type="button" id="btn" value="向东博客" onclick="openwin('http://justwinit.cn');" />