1、复习题 一、选择题 1、写“Hello World”的正确javascript语法是? (A) A. document.write("Hello World") B. "Hello World" C. response.write("Hello World") D. ("Hello World") 2、JS特性不包括( D ) A.解释性 B.用于客户端 C.基于对象 D.面向对象 3、下列JS的判断语句中( )是正确的 (A) A.if(i==0) B.if(i=0) C.if i==0 then D.i
2、f i=0 then 4、下列JavaScript的循环语句中( )是正确的 ( D ) A.if(i<10;i++) B.for(i=0;i<10) C.for i=1 to 10 D.for(i=0;i<=10;i++) 5、下列的哪一个表达式将返回假 ( B ) A.!(3<=1) B.(4>=4)&&(5<=2) C.(“a”==”a”)&&(“c”!=”d”) D.(2<3)||(3<2) 6、下列选项中,( )不是网页中的事件 (D) A.onclick
3、B.onmouseover C.onsubmit D.onpressbutton 7、有语句“var x=0;while(____) x+=2;”,要使while循环体执行10次,空白处的循环判定式应写为: ( C ) A.x<10 B. x<=10 C.x<20 D.x<=20 8、JS语句 ( B ) var a1=10;
4、var a2=20; alert(“a1+a2=”+a1+a2) 将显示( )结果 A.a1+a2=30 B.a1+a2=1020 C.a1+a2=a1+a2 9、将字串s中的所有字母变为小写字母的方法是 ( B) A.s.toSmallCase() B.s.toLowerCase() C.s.toUpperCase() D.s.toUpperChars() 10、以下( )表达式产生一个0~7之间(含0,7)的随机整数. ( C ) A.Math.flo
5、or(Math.random()*6) B.Math.floor(Math.random()*7) C.Math. floor(Math.random()*8) D.Math.ceil(Math.random()*8) 11、产生当前日期的方法是 ( C ) A.Now(); B.Date() C.new Date() D.n
6、ew Now() 12、如果想在网页显示后,动态地改变网页的标题 ( C ) A.是不可能的 B.通过document.write(“新的标题内容”) C. 通过document.title=(“新的标题内容”) D. 通过document.changeTitle(“新的标题内容”) 13、某网页中有一个窗体对象,其名称是mainForm,该窗体对象的第一个元素是按钮,其名称是myButton,表述该按钮对象的方法是 ( B ) A.
7、document.forms.myButton B.document.mainForm.myButton C.document.forms[0].element[0] D.以上都可以 14、HTML文档的树状结构中,()标签为文档的根节点,位于结构中的最顶层。 ( A ) A.B.
C.D.8、avascript实现省市级联菜单功能时,在添加城市列表前清空原来的下拉选项的代码是(C) A.document.myform.selCity.options.clear() B. document.myform.selCity.options.deleteAll() C. document.myform.selCity.options.length=0 D. document.myform.selCity.options.size=0 17、HMTL表单的首要标记是