【问题标题】:Open a onclick= on blank with a <input type="button"使用 <input type="button" 在空白处打开 onclick=
【发布时间】:2014-06-13 10:52:42
【问题描述】:

有谁知道如何在新窗口中打开带有 onclick= 的 input type="button" 的结果?

这是我的代码,在同一个窗口中打开结果:

<input type="button" name="enviar" id="enviar" class="roundShadow bkazul" value="ENVIAR" onclick="havingFunLearningMailValida(this.form.id)" /> 

任何帮助将不胜感激! 谢谢!

【问题讨论】:

  • 谢谢 Suresh!...我是一个绝对的初学者!..请您使用 window.open(url) 为这个

标签: html forms


【解决方案1】:

这里是使用window.open的示例代码

<input type="button" onclick="javascript:window.open('http://www.yahoo.com')" value="Click" />

Fiddle Also

【讨论】:

  • onclick="javascript:window.open('haveFunLearningMailValida(this.form.id)')" 不起作用...??
  • 它是一个函数。不是网址。
  • 告诉我你用过的功能。这样我就可以给你确切的答案了。
【解决方案2】:
<html>
<head>
<script type="text/javascript">
function openTab()
{
window.open();// can insert any web links inside the open under the double quotes
}
</script>
</head>
<body>
open a new tab<input type="button" value="new tab" 

onclick="openTab()"/>

</body>
</html>

【讨论】:

    猜你喜欢
    • 2010-12-20
    • 2010-10-02
    • 1970-01-01
    • 1970-01-01
    • 2014-10-15
    • 2012-03-30
    • 2011-05-14
    • 2013-09-07
    相关资源
    最近更新 更多