单项选择题下列不属于文档对象的方法的是()

A.createElement
B.getElementById
C.getElementByName
D.forms.length


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题如何在浏览器的状态栏放入一条消息?()

A.statusbar = "put your message here"
B.window.status = "put your message here"
C.window.status("put your message here")
D.status("put your message here")

2.单项选择题打开名为“window 2”的新窗口的JavaScript语法是()

A.open.new("http://www.w3schools.com","window2")
B.window.open("http://www.w3schools.com","window2")
C.new("http://www.w3schools.com","window2")
D.new.window("http://www.w3schools.com","window2")

3.单项选择题如何求得2和4中最大的数?()

A.Math.ceil(2,4)
B.Math.max(2,4)
C.ceil(2,4)
D.top(2,4)

4.单项选择题定义JavaScript数组的正确方法是?()

A.var txt = new Array="tim","kim","jim"
B.var txt = new Array(1:"tim",2:"kim",3:"jim")
C.var txt = new Array("tim","kim","jim")
D.var txt = new Array:1=("tim")2=("kim")3=("jim")

5.单项选择题如何在JavaScript中添加注释?()

A.' This is a comment
B.< !--This is a comment-->
C.//This is a comment

6.单项选择题for循环如何开始?()

A.for (i <= 5; i++)
B.for (i = 0; i <= 5; i++)
C.for (i = 0; i <= 5)
D.for i = 1 to 5

7.单项选择题如何编写当i不等于5时执行某些语句的条件语句?()

A.if =! 5 then
B.if <>5
C.if (i <> 5)
D.if (i != 5)

8.单项选择题如何编写当 i 等于 5 时执行某些语句的条件语句?()

A.if (i==5)
B.if i=5 then
C.if i=5
D.if i==5 then

9.单项选择题如何创建函数?()

A.function:myFunction()
B.function myFunction()
C.function=myFunction()

10.单项选择题如何在警告框中写入“Hello World”?()

A.alertBox="Hello World"
B.msgBox("Hello World")
C.alert("Hello World")
D.alertBox("Hello World")