• 2022-06-19
    点击页面的按钮,使之打开一个新窗口,加载一个网页,以下JavaScript代码中可行的是( )
    A: input type="button" value="new" onclick="window.location='new.html';"
    B:
    C:
    D:
  • C,D

    举一反三

    内容

    • 0

      点击页面中的按钮,使之打开一个新窗口,加载一个网页, 以下JavaScript代码能够实现该功能的是( ) A: inputtype=”button” value=”new” onclick=”open(‘new.html’,’_blank’)” B: C: D:

    • 1

      点击页面的按钮,使之打开一个新窗口,加载一个网页,以下JavaScript代码中可行的是( )。 A: <input type="button" value="new" onclick="window.location='new.html';"/> B: <input type="button" value="new" onclick=" location.assign('new.html');"/> C: <form target="_blank" action="new.html"> <input type="submit" value="new"/> </form> D: <input type="button" value="new" onclick="open('new.html', '_blank') "/>

    • 2

      在HTML页面中,定义了如下的Javascript函数,则正确调用该函数的HTML代码是()  A: <input name=”a” type=”button” onclick=”compute(this.value)” value=”+”>  B: <input name=”b” type=”button” onclick=”compute(‘-‘)” value=”-”>  C: <input name=”c” type=”button” onclick=”compute(“*”)” value=”*”>  D: <input name=”d” type=”button” onclick=”compute(/ )” value=”/”>

    • 3

      在HTML页面中包含一个按钮控件mybutton,如果要实现点击该按钮时调用已定义的Javascript函数compute,要编写的HTML代码是( )。 未知类型:{'options': ['&#91;input name=”mybutton” type=”button” onClick=”compute” value=”计算”&#93;', '&#91;input name=”mybutton” type=”button” onFocus=”compute()” value=”计算”&#93;', '&#91;input name=”mybutton” type=”button” onClick=”function compute()” value=”计算”&#93;', '&#91;input name=”mybutton” type=”button” onClick=”compute()” value=”计算”&#93;'], 'type': 102}

    • 4

      在HTML页面中包含一个按钮控件mybutton,如果要实现点击该按钮时调用已定义的Javascript函数compute,要编写的HTML代码是( ) A: &lt;input type="button" name="mybutton" value="计算" onblur="compute()" /&gt; B: &lt;input type="button" name="mybutton" value="计算" onfocus="compute()" /&gt; C: &lt;input type="button" name="mybutton" value="计算" onclick="function compute()" /&gt; D: &lt;input type="button" name="mybutton" value="计算" onclick="compute()" /&gt;