javaScript练习题_原创精品文档.pdf
以家为家,以乡为乡,以国为国,以天下为天下。——《管子》
.
JS练习题
JS练习题.
一、选择题
二、不定项选择题
三、填空
四、判断
五、阅读程序写结果
六、程序题
七、设计题
.
以家为家,以乡为乡,以国为国,以天下为天下。——《管子》
.
一、选择题
1、写“HelloWorld”的正确javascript语法是?()
2、JS特性不包括()
A.解释性B.用于客户端C.基于对象D.面向对象
3、下列JS的判断语句中()是正确的
A.if(i==0)B.if(i=0)C.ifi==0thenD.ifi=0then
4、下列JavaScript的循环语句中()是正确的
A.if(i10;i++)B.for(i=0;i10)
C.fori=1to10D.for(i=0;i=10;i++)
5、下列的哪一个表达式将返回假()
A.!(3=1)B.(4=4)(5=2)
C.(“a”==”a”)(“c”!=”d”)D.(23)||(32)
6、下列选项中,()不是网页中的事件
A.onclickB.onmouseoverC.onsubmitD.onpressbutton
7、有语句“varx=0;while(____)x+=2;”,要使while循环体执行10次,空白处的循环判定式
应写为:()
A.x10B.x=10C.x20D.x=20
8、JS语句
vara1=10;
vara2=20;
alert(“a1+a2=”+a1+a2)
将显示()结果
A.a1+a2=30B.a1+a2=1020C.a1+a2=a1+a2
9、将字串s中的所有字母变为小写字母的方法是()
A.s.toSmallCase()B.s.toLowerCase()
C.s.toUpperCase()D.s.toUpperChars()
10、以下()表达式产生一个0~7之间(含0,7)的随机整数.
A.Math.floor(Math.random()*6)
B.Math.floor(Math.random()*7)
C.Math.floor(Math.random()*8)
D.Math.ceil(Math.random()*8)
11、产生当前日期的方法是()
A.Now();B.Date()C.newDate()D.newNow()
12、如果想在网页显示后,动态地改变网页的标题()
A.是不可能的B.通过document.write(“新的标题内容”)