Javascript考试题目选择题

复习题

一、选择题

1、写“Hello World”的正确javascript语法是? (A) A. document.write(\ B. \ C. response.write(\ D. (\2、JS特性不包括( D ) A.解释性 B.用于客户端 C.基于对象 D.面向对象 3、下列JS的判断语句中( )是正确的 (A) A.if(i==0) B.if(i=0) C.if i==0 then D.if 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 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; 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.floor(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.new Now()

12、如果想在网页显示后,动态地改变网页的标题 ( C ) A.是不可能的 B.通过document.write(“新的标题内容”) C. 通过document.title=(“新的标题内容”) D. 通过document.changeTitle(“新的标题内容”)

13、某网页中有一个窗体对象,其名称是mainForm,该窗体对象的第一个元素是按钮,其名称

是myButton,表述该按钮对象的方法是 ( B ) A.document.forms.myButton B.document.mainForm.myButton C.document.forms[0].element[0] D.以上都可以 14、HTML文档的树状结构中,()标签为文档的根节点,位于结构中的最顶层。 ( A ) A.B.C.D. </p><p>15、在HTML页面中,CSS样式的属性名为background-image对应的style对象的属性名是</p><p>(B) </p><p>A.background B.backgroungImage C.image D.background </p><p>16、在使用Javascript实现省市级联菜单功能时,在添加城市列表前清空原来的下拉选项的代码是(C) </p><p>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表单的首要标记是<form>,<form>标记的参数method表示表单发送的方法,可能为get或post,下列关于get和post的描述正确的是(D) A.post方法传递的数据对客户端是不可见的 </p><p>B.get请求信息以查询字符串的形式发送,查询字符串长度没有大小限制 C.post方法对发送数据的数量限制在255个字符之内 D.get方法传递的数据对客户端是不可见的 </p><p>18、在DOM对象模型中,下列选项中的()对象位于DOM对象模型的第二层。(选择二项) (AB) A.history B.document C.button D.text 19、在HTML文档对象模型中,history对象的()用于加载历史列表中的下一个URL页面。 ( C ) A.next() B.back() C.forward() D.go(-1) </p><p>20、在Javascript中要改变页面文档的背景色,需要修改document对象的()属性。 ( C ) A.BackColor B.BackgroundColor C.BgColor D.Background </p><p>21、在HTML页面中,不能与onChange事件处理程序相关联的表单元素有(D) A.文本框 B.复选框 C.列表框 D.按钮 </p><p>22、在HTML页面上编写Javascript代码时,应编写在()标签中间。 (B) A.<javascript>和</javascript> B.<script>和</script> C. <head>和</head> D. <body>和</body> 23、在Javascript浏览器对象模型中,window对象的()属性用来指定浏览器状态栏中显示的临时消息。 (A) </p><p>A.status B.screen C.history D.document </p><p>24、编写Javascript函数实现网页背景色选择器,下列选项中正确的是(B) </p><p>A.function change(color){ window.bgColor=color; </p><p>} </p><p>B. function change(color){ document.bgColor=color; } </p><p>C. function change(color){ body.bgColor=color; </p><p>} </p><p>D. function change(color){ form.bgColor=color; } </p><p>25、在Javascript中,可以使用Date对象的()方法返回一个月中的每一天。 (A) </p><p>A.getDate B.getYear C.getMonth D.getTime </p><p>26、在Javascript中,对于浏览器对象的层次关系理解正确的是()(选择二项) (AD) </p><p>A.window对象是所有页面内容的根对象 </p><p>B.document对象包含location对象和history对象 C.location对象包含history </p><p>D.document对象包含form对象 </p><p>27、下列选项中关于浏览器对象的说法错误的是( C ) </p><p>A.history对象记录了用户在一个浏览器中已经访问过的URLs </p><p>B.location对象相当于IE浏览器中的地址栏,包含关于当前URL地址的信息 C.location对象是history对象的父对象 D.location对象是window对象的子对象 </p><p>28、在HTML页面中包含一个按钮控件mybutton,如果要实现点击该按钮时调用已定义的Javascript函数compute,要编写的HTML代码是(D) </p><p>A.<input name=”mybutton” type=”button” onBlur=”compute()”value=”计算”> B.<input name=”mybutton” type=”button” onFocus=”compute()”value=”计算”> </p><p>C.<input name=”mybutton” type=”button” onClick=”function compute()”value=”计算”> D.<input name=”mybutton” type=”button” onClick=”compute()”value=”计算”> 29、分析下面的Javascript代码段,输出结果是(C) </p><p>var mystring=”I am a student”; var a=mystring.substring(9,13); document.write(a); </p><p>A.stud B.tuden C.uden D.udent </p><p>30、Javascript中制作图片代替按钮的提交效果需要手动提交方法submit(),以下调用正确的是(C) </p><p>A.submit();B.myform.submit() C.document.myform.submit() D.window.myform.submit(); 31、在HTML页面中包含如下所示代码,则编写Javascript函数判断是否按下键盘上的回车键正确的编码是(C) </p><p><input name=”password” type=”text” onkeydown=”myKeyDown()”> </p><p>A. function myKeyDown(){ </p><p>if (window.keyCode==13) alert(“你按下了回车键”); B. function myKeyDown(){ </p><p>if (document.keyCode==13) alert(“你按下了回车键”); C. function myKeyDown(){ </p><p>if (event.keyCode==13) alert(“你按下了回车键”); D. function myKeyDown(){ </p><p>if (keyCode==13) </p><p> alert(“你按下了回车键”); </p><p>32、如果在HTML页面中包含如下图片标签,则选项中的()语句能够实现隐藏该图片的功能。 (D) <img id=”pic” src=”Sunset.jpg” width=”400” height=”300”> </p><p>A.document.getElementById(“pic”).style.display=”visible”; B.document.getElementById(“pic”).style.display=”disvisible”; C.document.getElementById(“pic”).style.display=”block”; D.document.getElementById(“pic”).style.display=”none”; </p><p>33、如果在HTML页面中包含如下图片标签,则在下划线处添加()代码能够实现隐藏该图片的功能。 ( D ) <img id=”pic” src=”Sunset.jpg” width=”400” height=”300” ____________ > </p><p>A. style=”display:visible”; B. style=”display:disvisible”; C. style=”display:block”; D. style=”display:none”; 34、下列选项中,()段HTML代码所表示的“返回”链接能够正确实现IE工具栏中“后退”按钮的功能。(选择二项) (AD) </p><p>A. <a href=”javascript:history.go(-1)”>返回</a> B. <a href=”javascript:location.back()”>返回</a> C. <a href=”javascript: location go(-1)”>返回</a> D. <a href=”javascript:history.back()”>返回</a> </p><p>35、在HTML文档中包含如下超链接,要实现当鼠标移入该链接时,超链接文本大小变为30px,选项中的编码正确的是(C) </p><p>A.<a href=”#” onmouseover=”this.style.fontsize=30px”>注册</a> B.<a href=”#” onmouseout=”this.style.fontsize=30px”>注册</a> C.<a href=”#” onmouseover=”this.style.font-size=30px”>注册</a> D.<a href=”#” onmouseout=”this.style.font-size=30px”>注册</a> </p><p>36、在HTML页面上,当按下键盘上的任意一个键时都会触发Javascript的()事件。 </p><p>( D ) </p><p>A.onFocus B.onBlur C.onSubmit D.onKeyDown </p><p>37、在HTML页面中,定义了如下所示的Javascript函数,则正确调用该函数的HTML代码是(选择二项) (AB) </p><p>function compute(op){ alert(op); } </p><p>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=”/”> </p><p>38、在HTML页面上包含如下创建层的语句,那么编写Javascript语句实现显示该层的语句错误的是(D) <html> <body> </p><p><div id=”imageLayer” style=”display:none;”> </p><p><img src=”images/Sunset.jpg” width=”200” height=”100”></div> </body> <html> </p><p>A. document.getElementByTagName(“div”)[0].style.display=”block” B.document.getElementById(“imageLayer”).style.display=”block”; </p><p>C.document.getElementByName(“imageLayer”)[0].style.display=”block”; D.document.getElementByName(“imageLayer”).get(0).style.display=”block”; 39、分析下面的Javascript代码段,输出结果是(C) </p><p>var s1=parseInt(“101中学”); document.write(s1); </p><p>A. NaN B.101中学 C.101 D.出现脚本错误 </p><p>40、在HTML中,点击图片”previous.gif”上的超级链接后页面将加载历史列表中的上一个URL页面。代码如下所示,应在下划线处填入(A) </p><p><a href=_________><img src=”previous.gif” width=”67” height=”21”></a> </p><p>A.”javascript:history.go(-1)”; B. “history.go(1)” C. “history.go(-1)” D. “javascript:history.go(1)” 41、在HTML页面上包含如下所示的层对象,则javascript语句document.getElementById(“info”).innerHTML的值是(A) <div id=”info” style=”display:block”><p>请填写</p></div> A.请填写 B.<p>请填写</p> C.id=”info” style=”display:block” D.<div id=”info” style=”display:block”><p>请填写</p> 42、以下哪条语句会产生运行错误(A) </p><p> A.varobj = ( ); B.varobj = [ ]; C.varobj = { }; D.var obj =/ /; </p><p>1、选择题:9题 </p><p>1、 要求用JavaScript实现下面的功能:在一个文本框中内容发生改变后,单击页面的其他部分将弹出一个消息框显示文本框中的内容,下面语句正确的是() A. <input type=\.value)\ B. <input type=\.value)\ C. <input type=\.value)\ D. <input type=\ </p><p>正确答案是: B </p><p>2、 在HTML页面中,下面关于Window对象的说法不正确的是()。 </p><p> A. Window对象表示浏览器的窗口,可用于检索有关窗口状态的信息 B. Window对象是浏览器所有内容的主容器 </p><p> C. 如果文档定义了多个框架,浏览器只为原始文档创建一个Window对象,无须为每个框架创建Window对象 </p><p></p><div class="page"><ul><li><a href=mlhd_4a0vm3dj503gznb0fxcf_1.html class="hover" >1</a></li><li><a href=mlhd_4a0vm3dj503gznb0fxcf_2.html>2</a></li><li><a href=mlhd_4a0vm3dj503gznb0fxcf_3.html>3</a></li><li><a href=mlhd_4a0vm3dj503gznb0fxcf_4.html>4</a></li><li><a title=下一页 href=mlhd_4a0vm3dj503gznb0fxcf_2.html>>></a></li><li><a href=mlhd_4a0vm3dj503gznb0fxcf_10.html>10</a></li></ul></div></div> <div style="margin:0 auto;text-align:center;overflow:hidden"></div> <div class="hm-t-main"> <div class="hm-t-header"><h4><a rel="nofollow" target="_blank" href="/mlhdl_4a0vm3dj503gznb0fxcf.html">下载:Javascript考试题目选择题.doc</a></h4></div> </div> <div class="nlt new"><div id="hm_t_19094"><div class="hm-t-container"><div class="hm-t-main"><div class="hm-t-header"><h4>最近浏览</h4></div> <ul class="hm-t-list hm-t-list-txt"> <li><a title="Javascript考试题目选择题" href=mlhd_4a0vm3dj503gznb0fxcf_1.html>Javascript考试题目选择题</a></li><li><a title="设计实现简单的通讯录C++课程设计" href=mlhd_9t1u03agx36h1tx45fgi_3.html>设计实现简单的通讯录C++课程设计</a></li><li><a title="检测与自动化 doc" href=mlhd_3pm748wpql8xswm2y1ft_9.html>检测与自动化 doc</a></li><li><a title="机械设计基础期末考试练习题" href=mlhd_90bpi2d0w22i4cx3qijx_3.html>机械设计基础期末考试练习题</a></li><li><a title="护理管理第三版试题" href=mlhd_958874wwml1od1f2lyxi_4.html>护理管理第三版试题</a></li><li><a title="《文字录入》课程教学大纲" href=mlhd_6wbwc1647q0zn011oo6h6et871df8g0194c_1.html>《文字录入》课程教学大纲</a></li><li><a title="表哥驾到答案" href=mlhd_2iyf46pq4o565ja3uu22_1.html>表哥驾到答案</a></li><li><a title="TDCS系统" href=mlhd_1mqe92jbau667gi1z1n1_1.html>TDCS系统</a></li><li><a title="中国法律思想史(一)夏商周时期神权法思想" href=mlhd_51qdb36wzo7916095d3r_1.html>中国法律思想史(一)夏商周时期神权法思想</a></li><li><a title="UG二次开发之NX_Open编程指南" href=mlhd_7fg9g5evs44oweg0pist_1.html>UG二次开发之NX_Open编程指南</a></li> </ul></div><div style="margin:0 auto;text-align:center;"><br> </div></div></div></div> <div class="nlt new"><div id="hm_t_19094"><div class="hm-t-container"><div class="hm-t-main"> <div class="hm-t-header"><h4>最新搜索</h4></div> <ul class="hm-t-list hm-t-list-txt"> <li><a title="SQL SERVER数据库(实验)." href="mlhs_02b02902400w02b01x02a02e01x02ak1cjn2ioj014i3iuj001501a_1.html">SQL SERVER数据库(实验).</a></li><li><a title="代理记账业务规范和财务会计管理制度范文" href="mlhs_fkzmx2rlcrvqffegblr7opvngp8rvmgblfmirkxof5mx2g8mip2pvnk1z_1.html">代理记账业务规范和财务会计管理制度范文</a></li><li><a title="全国28个省、直辖市、自治区革命老区县市名单" href="mlhs_g2wh6l01e01kffuni99hdnhwsd2iki9hdpnulh7gfutwpgotpa9gfugjjikiglpggl_1.html">全国28个省、直辖市、自治区革命老区县市名单</a></li><li><a title="长余辉材料资料" href="mlhs_tj3fo9scpkeok2hrwkk2h_1.html">长余辉材料资料</a></li><li><a title="2018-2024年中国体腔热灌注化疗机市场运行格局及投资战" href="mlhs_01e01c01d01k01901e01c01e01ginoffxh6lfo3pjomb1m6kliggeun87ke2ikih8aseoqx8kl8i80gjujh1rwkjdk_1.html">2018-2024年中国体腔热灌注化疗机市场运行格局及投资战</a></li><li><a title="英文期刊缩写与全称对照(J)" href="mlhs_pv5k1zkdbg7ep49g49ff2g2wo34i61mef014022015_1.html">英文期刊缩写与全称对照(J)</a></li><li><a title="参考习题" href="mlhs_gjmpabfhcu54_1.html">参考习题</a></li><li><a title="高等汉语水平考试" href="mlhs_ul4ocple1rn1ldginnpabrmd_1.html">高等汉语水平考试</a></li><li><a title="夹套式反应釜设计说明书分解" href="mlhs_hmhhnbirzgjxiokst8rlqrkxrn8k5qfhig7ar8j_1.html">夹套式反应釜设计说明书分解</a></li><li><a title="东华《市场综合调研》18春平时作业2" href="mlhs_ffggge9hmikih8ap30glkrnnnpw9hn01d01kk6dinnk52focffe01e_1.html">东华《市场综合调研》18春平时作业2</a></li></ul></div></div></div></div> <div class="search"> <form style="display: inline;" id=f1 name=f1 method="POST" onSubmit="javascript:c();return false;"> <div class="p_searchinputbox"> <div class="p_search_seclet"><h3 id="j_searchType">站内搜索</h3></div><p> <input type="text" autocomplete="off" maxlength="38" name="word" placeholder class="searchinput"></p> <input type="submit" class="searchsubmit" onclick="javascript:c();return false;"></div> </form> </div> <div id="ft"> <a href="javascript:history.go(-1)"><span class="backPrevPage" style=""></span></a> <a href="javascript:pageScroll();"><span id="backTop"></span></a> <div class="bx1"> <span class="pc_ver"> <a href="#" onClick="javascript:setCookie('gotoweb', 'true', 1);window.location.href=window.location.href.replace('//m.','//www.').replace('/m','/')">电脑版</a> </span> <span class="info"> <a href="about.asp?id=3" target="_blank"><strong>关于南京廖华答案网</strong></a> </span> </div> <div class="bx2"><span id=bb></span>联系客服:779662525#qq.com(#替换为@) <a href="https://beian.miit.gov.cn/" target="_blank" class="text">苏ICP备20003344号-4</a></div> </div> <!-- footer End --></div> <script type="text/javascript">function go2(id){window.location.href='http://m.35331.cn/mlhdl_'+id+'.html';}</script> <script src="css/jquery.min.js"></script> </body></html>